Course: Data Analytics (Finals Practicum & Lab Assignment 05)
Author: Imran Mian (@memrranmian)
Domain: Applied Software Engineering, Systems Architecture & Core Python Internals
This suite is structured to demonstrate proficiency in core software engineering, data analytics workflows, and systems-level programming:
| Competency Domain | Core Technical Skills & Applied Modules | Production Pattern Implemented |
|---|---|---|
| Concurrency & Synchronization | threading.Thread, threading.Lock, race condition prevention |
Multi-threaded pipeline decoupling compute and I/O reporting |
| Functional Data Pipelines | map(), filter(), functools.reduce(), zip(), lambda |
Declarative, pure-function data pipelines (ETL, financial aggregations) |
| Modular Systems & Architecture | Python Packaging (__init__.py, __all__), importlib.reload(), sys.path |
Enterprise package design, decoupling interfaces from implementation |
| Systems & Storage Engineering | os, os.stat, seek(), tell(), file streams (read, readline, readlines) |
Low-level pointer manipulation, atomic file operations, resource safety (try...finally) |
| Computer Vision & Media | Pillow (PIL.Image, PIL.ImageDraw), color matrices (RGB, RGBA, L) |
Batch multichannel transformations, spatial validation, dimension filtering |
| Defensive Programming & QA | Custom Exception Hierarchies (InvalidMarksError), strict validation |
Boundary defense against non-numeric data, missing records, zero-division |
| Temporal & Calendar Analytics | datetime.datetime, datetime.date, calendar.monthrange, calendar.TextCalendar |
Automated fiscal and working-day schedule calculations |
The Applied Python Systems Suite is an enterprise-grade collection of five modular, real-world Python applications engineered to demonstrate advanced programming paradigms, systems programming, and algorithmic design.
The suite emphasizes:
- Production-Grade Architecture: Custom packaging, dynamic module loading, and clean separation of concerns.
- Concurrency & Synchronization: Multi-threaded pipeline execution with thread safety and mutual exclusion locks (
threading). - Functional Programming: Declarative transformations and reductions utilizing
map(),filter(),reduce(), andlambdaexpressions. - Resilient I/O & OS Internals: Low-level file pointer manipulation with
seek(), OS stat querying, atomic file operations, and safe resource lifecycle management (try-finally). - Digital Image Processing: Multichannel image transformation and filtering pipelines powered by Pillow (
PIL).
applied-python-systems-suite/
β
βββ Question_1.py # University Student Result & Exception Management Engine
βββ Question_2.py # Smart Business Utility & Financial Reporting Pipeline
βββ Question_3.py # Library Inventory & Low-Level File Management System
βββ Question_4.py # Digital Image Processing & Transformation Pipeline
βββ Question_5.py # Multi-Threaded Employee Attendance & Payroll System
β
βββ business_utils.py # Custom Utility Module (Financial & DateTime operations)
βββ report_utils.py # Custom Reporting Module (Calendar & Ledger generation)
βββ book_operations.py # Root Interface for Library Operations
β
βββ library/ # Custom Python Package (Modular Architecture)
β βββ __init__.py # Package Initialization & Public Symbol Exposure
β βββ book_operations.py # Inventory CRUD, Title Search (*args), & Attributes (**kwargs)
β βββ file_operations.py # Low-level I/O, File Pointers (seek/tell), & os.stat Inspection
β
βββ SampleInputImages/ # Test Image Corpus for Image Processing Pipeline
β βββ campus_view.png # High-resolution test image (800x600 PNG)
β βββ library_hall.jpg # High-resolution photo (700x700 JPEG)
β βββ student_badge.png # Transparent RGBA sample (400x300 PNG)
β βββ icon_logo.bmp # Bitmap graphic (300x300 BMP)
β βββ corrupt_image.xyz # Faulty input asset for exception verification
β
βββ AttendanceRecords/ # Auto-generated Enterprise Attendance & Payroll Data
β βββ employee_attendance.txt # Pipe-delimited raw attendance storage
β βββ monthly_payroll_report.txt # Formatted final payroll audit report
β
βββ LibraryRecords/ # Auto-generated Library Records & Metadata
β βββ library_inventory.txt # Master inventory flat file
β βββ final_inventory_report.txt # Formatted tabular inventory report
β
βββ ProcessedImages/ # Batch Image Processing Outputs (16 transformed assets)
β βββ *_cropped.* # Center-cropped image assets
β βββ *_gray.* # Grayscale converted assets
β βββ *_resized_300x300.* # Standardized resolution assets
β βββ *_rot90.* # 90-degree orthogonal rotated assets
β
βββ student_results_report.txt # Generated Academic Performance Audit
βββ business_monthly_report.txt # Generated Monthly Financial Audit
βββ .gitignore # Git Exclusion Rules (pycache, envs, binaries)
βββ README.md # Comprehensive Project Documentation
A grading and academic classification engine featuring domain-specific exception models and safe file streaming.
-
Variadic Functions (
*args): Ingests arbitrary numbers of subject marks per student. -
Functional Analytics: Employs
map()withlambdafor percentage computations andfilter()for identifying high-scoring subjects ($\ge 80$ ). -
Domain Exception Handling: Custom user-defined exception
InvalidMarksErroralongside handling for non-numeric marks (TypeError), missing metadata (ValueError), and empty sequences (ZeroDivisionError). -
Resource Safety: Guarantees deterministic file handle closure via
try...finallyblocks.
A business analytics engine showcasing modularization, module resolution internals, and dynamic reloading.
-
Modular Decoupling: Implements custom modules
business_utils.pyandreport_utils.py. -
Python Runtime Internals: Demonstrates module path resolution via
sys.pathand runtime hot-reloading withimportlib.reload(). -
Functional Sales Processing:
- Uses
map()to dynamically compute a 5% tax surcharge. - Uses
filter()to extract high-value corporate transactions ($> \text{Rs. } 10,000$ ). - Uses
functools.reduce()to compute total enterprise revenue and tax liabilities. - Uses
zip()to map generated transaction IDs (TXN-XXXXXX) to transaction amounts into a hash map.
- Uses
-
Benchmark Timing: Measures exact report compilation latency via
time.time().
An inventory management package illustrating enterprise package structures and low-level byte/stream manipulation.
- Package Architecture: Organizes logic into an importable
librarypackage containingbook_operationsandfile_operations. - Variadic Parameter Handling: Flexible book ingestion using
**kwargsand multi-title batch search queries using*args. - Stream Operations & Pointer Manipulation: Demonstrates granular file operations using
read(),readline(),readlines(), and explicit pointer rewinding withseek()andtell(). - OS Systems Programming: Inspects inode metadata and file permissions via
os.stat(), verifies file existence, and performs transactional file rename/deletion.
A batch digital signal and media processing engine powered by the Python Imaging Library (Pillow / PIL).
- Attribute Inspection: Extracts dimensions, color channels, formats, and compression modes across JPEG, PNG, and BMP formats.
-
Batch Transform Pipelines: Utilizes
map()with higher-order functions to execute batch image operations:- Resizing to standard dimensions (
$300 \times 300$ ). - Orthogonal coordinate cropping with boundary validation.
- Coordinate matrix transformations (90Β° rotations).
- Color quantization and grayscale mode conversions (
Lmode).
- Resizing to standard dimensions (
-
Predicate Filtering: Filters images with dimensions exceeding
$500 \times 500$ pixels usingfilter(). -
Fault Tolerance: Robust handling for unsupported image formats (
UnidentifiedImageError), missing paths, and out-of-bound crop coordinates.
A concurrent workforce payroll engine designed with Python's threading and POSIX calendar tools.
-
Calendar Calculations: Calculates working days (MonβFri) dynamically for any target calendar month via
calendar.monthrange()anddatetime.date. -
Threaded Concurrency: Decouples heavy calculation from report generation across concurrent worker threads:
-
Thread 1 (
HoursCalculationThread): Validates and calculates daily hours and daily wage maps usingmap(). -
Thread 2 (
PayrollReportThread): Performs salary reductions (reduce()), flags underperforming staff ($< 6.0\text{ hrs/day}$ viafilter()), and formats the final ledger.
-
Thread 1 (
-
Thread Safety: Implements mutual exclusion locks (
threading.Lock) over shared data structures. - Continuous File Streaming: Preserves historical audit records through sequential file append operations.
| Category | Modules & Concepts Demonstrated |
|---|---|
| Language & Runtime | Python 3.10+, sys, importlib, math, random, time |
| Concurrency & Threading | threading.Thread, threading.Lock, thread synchronization |
| Functional Paradigms | map(), filter(), functools.reduce(), zip(), lambda expressions |
| Systems & Storage I/O | os, os.stat(), open(), read(), readline(), readlines(), seek(), tell() |
| Temporal Calculations | datetime.datetime, datetime.date, calendar.TextCalendar, calendar.monthrange() |
| Computer Vision / PIL | PIL.Image, PIL.ImageDraw (Pillow) |
| Data Structures | Dictionaries, Sets, Lists, Tuples, *args, **kwargs |
| Exception Handling | Custom Exceptions (InvalidMarksError), ZeroDivisionError, TypeError, ValueError, FileNotFoundError |
Ensure you have Python 3.10 or higher installed:
python --versiongit clone https://github.com/memrranmian/applied-python-systems-suite.git
cd applied-python-systems-suiteThe suite uses standard library modules for Questions 1, 2, 3, and 5. Question 4 requires Pillow:
pip install PillowEach question is an independent, self-contained system. Execute each using the standard Python interpreter:
# Run Question 1: Student Result & Exception Management
python Question_1.py
# Run Question 2: Business Utilities & Modular Analytics
python Question_2.py
# Run Question 3: Library Package & File Stream Management
python Question_3.py
# Run Question 4: Batch Image Processing & Transformations
python Question_4.py
# Run Question 5: Multithreaded Employee Attendance & Payroll
python Question_5.pyTo run all test suites in sequence:
python Question_1.py; python Question_2.py; python Question_3.py; python Question_4.py; python Question_5.pyAll systems run deterministically and generate persistent artifacts in their respective directories:
- Academic grades audit saved to
student_results_report.txt. - Monthly business financial ledger saved to
business_monthly_report.txt. - Complete library inventory saved to
LibraryRecords/final_inventory_report.txt. - Transformed images saved to
ProcessedImages/. - Enterprise payroll report saved to
AttendanceRecords/monthly_payroll_report.txt.
This repository is licensed under the MIT License.