Location: Ch-1_OOP/
Master the fundamentals of OOP in Python, the backbone of scalable data applications.
- 1_basics.py - Core OOP concepts: classes, objects, attributes, and methods
- 2_constructors.py - Understanding
__init__and object initialization - 3_encapsulation.py - Data hiding, private/protected attributes, and properties
- 4_DataExt_Class.py - Working with dataclass decorator for simplified class creation
- 5_methods.py - Instance methods, class methods, and static methods
- How to design and structure classes effectively
- Encapsulation principles for robust code
- Using dataclasses for concise, maintainable code
- Method types and their use cases
- Sample data files in
Files/:orders.csv,orders.json,orders.tsv
Location: Ch-2_Inheritance/
Learn how to create hierarchical class structures and reuse code through inheritance.
- 1_single_level.py - Single inheritance: parent-child class relationships
- 2.1_multiple.py - Multiple inheritance: inheriting from multiple classes (Part 1)
- 2.2_multiple.py - Multiple inheritance: Method Resolution Order (MRO) and diamond problem (Part 2)
- 3_multi_level.py - Multi-level inheritance: grandparent β parent β child chains
- Advantages and pitfalls of inheritance patterns
- Method Resolution Order (MRO) and how Python resolves method calls
- Handling the diamond problem in multiple inheritance
- When to use inheritance vs. composition
Location: Ch-3_Polymorphism&Decorators/
Leverage polymorphism and decorators to write flexible, DRY Python code.
- 1_polymorphism.py - Method overriding, duck typing, and interface design
- 2_decorators.py - Function decorators: enhancing functions without modifying them
- 3_decorator_pandas.py - Practical decorators for data manipulation with pandas
- Writing polymorphic code that works with multiple types
- Creating custom decorators for logging, validation, and performance monitoring
- Decorator patterns in data processing workflows
- Higher-order functions and function wrappers
orders.csv- Sample data for decorator examples
Location: Ch-4_Multi-Threading/
Master concurrent programming with threads for I/O-bound operations.
- 1_multi-threading.py - Thread basics, creating and managing threads, the GIL, and thread synchronization
- Thread creation and lifecycle
- Thread safety and locks
- Race conditions and deadlocks
- Practical examples for I/O-bound tasks
- When to use multi-threading vs. multiprocessing
- Thread synchronization mechanisms (locks, events, conditions)
- Avoiding common threading pitfalls
- Performance benefits for I/O-bound operations
Location: Ch-5_Pydantic/
Learn data validation and serialization using Pydantic, essential for data pipelines.
-
1_basics.ipynb - Core concepts: models, validation, type hints
- Creating Pydantic models
- Automatic type validation
- Configuration options
-
2_Fields.ipynb - Advanced field configurations
- Field constraints and validators
- Custom validation logic
- Nested models and complex types
-
3_Serialization.ipynb - Serialization and deserialization
- Converting models to dictionaries and JSON
- Handling complex data types
- Schema generation
- Building robust data validation pipelines
- Ensuring data quality at ingestion points
- Serialization for APIs and storage
- Integration with FastAPI and other frameworks
Location: Ch-6_Async/
Harness async/await for highly concurrent, non-blocking operations.
- 1_basics.py - Async fundamentals: coroutines, event loops, and async/await syntax
- 2_await_api.py - Calling async functions and handling single API requests
- 3_multiple_apis.py - Managing concurrent API calls with
asyncio.gather() - 4_multiple_tasks.py - Coordinating multiple async tasks with different timing patterns
- Event loop mechanics and the async runtime
- Writing async functions and coroutines
- Efficient concurrent I/O with minimal overhead
- Task scheduling and coordination
- Far superior performance compared to threading for I/O operations
Location: Ch-7_APIs/
Master HTTP APIs and integration patterns for data retrieval.
- 1_apis.ipynb - Working with REST APIs
- Making HTTP requests (GET, POST, PUT, DELETE)
- Handling authentication and headers
- Parsing and processing JSON responses
- Error handling and retries
- Real-world API integration examples
- HTTP fundamentals for data engineers
- API authentication and security
- Data parsing and transformation
- Building robust API clients
- Integration with data pipelines
Location: Ch-8_PyTest/
Write comprehensive tests to ensure code quality and reliability.
-
1_Basics/
main.py- Simple functions to testtest_main.py- Basic pytest assertions and test structure
-
2_Classes/
main.py- Class implementations for testingtest_main.py- Testing class methods and properties
-
3_CheckErrors/
main.py- Functions that raise exceptionstest_main.py- Testing exception handling withpytest.raises()
-
4_Parametrized_Testing/
main.py- Functions requiring multiple test inputstest_main.py- Using@pytest.mark.parametrizefor data-driven tests
-
Mocks/
main.py- Code with external dependenciestest_main.py- Mocking external dependencies and side effects
- Writing clear, maintainable test cases
- Testing class-based code
- Exception testing strategies
- Parametrized tests for comprehensive coverage
- Mocking and dependency injection for isolated tests
- Creating reproducible test environments
Location: Ch-9_OS/
Work with the operating system for file handling and system tasks.
- 1_basics.py - File and directory operations
- Reading and writing files
- Directory traversal and manipulation
- Path handling and normalization
- File metadata and permissions
- Working with CSV, JSON, and other formats
Data/directory contains time-series CSV files:2026-01-01.csv2026-01-14.csv2026-01-15.csv
- Cross-platform file handling with
pathlib - Efficient data file operations
- Directory organization and automation
- File I/O best practices
- Working with various data formats
- Python 3.8 or higher
- pip or conda for package management
-
Clone or download the repository:
git clone <repository-url> cd PythonAdvanced
-
Create a virtual environment:
python -m venv .venv .venv\Scripts\activate # On Windows source .venv/bin/activate # On macOS/Linux
-
Install dependencies:
pip install -r requirements.txt
This course recommends using Jupyter notebooks for interactive learning, especially for chapters 5 and 7.
PythonAdvanced/
βββ Ch-1_OOP/ # Object-Oriented Programming
β βββ 1_basics.py
β βββ 2_constructors.py
β βββ 3_encapsulation.py
β βββ 4_DataExt_Class.py
β βββ 5_methods.py
β βββ Files/ # Sample data files
βββ Ch-2_Inheritance/ # Inheritance patterns
βββ Ch-3_Polymorphism&Decorators/ # Polymorphism & Decorators
βββ Ch-4_Multi-Threading/ # Concurrent programming
βββ Ch-5_Pydantic/ # Data validation with Pydantic
βββ Ch-6_Async/ # Asynchronous programming
βββ Ch-7_APIs/ # Working with APIs
βββ Ch-8_PyTest/ # Testing with pytest
β βββ 1_Basics/
β βββ 2_Classes/
β βββ 3_CheckErrors/
β βββ 4_Parametrized_Testing/
β βββ Mocks/
βββ Ch-9_OS/ # OS and file operations
β βββ Data/ # Sample data files
βββ README.md # This file
-
Follow the Progressive Difficulty: Start with Chapter 1 and progress sequentially. Each chapter builds on previous concepts.
-
Code Along: Don't just read the codeβexecute it, modify it, and experiment.
-
Run Tests: Chapter 8 provides excellent examples of how code should be tested. Study the test patterns.
-
Interactive Learning: Use Jupyter notebooks (Chapters 5 & 7) for interactive exploration.
-
Real-World Context: Each chapter is designed with data domain applications in mind. Consider how concepts apply to your specific use case.
python Ch-1_OOP/1_basics.pyjupyter notebook Ch-5_Pydantic/1_basics.ipynb# Run all tests in Ch-8_PyTest
pytest Ch-8_PyTest/
# Run specific test file
pytest Ch-8_PyTest/1_Basics/test_main.py -v
# Run with coverage
pytest Ch-8_PyTest/ --covBy completing this tutorial, you will be able to:
β
Design and implement robust object-oriented Python applications
β
Create complex class hierarchies using inheritance
β
Write flexible, maintainable code with polymorphism and decorators
β
Leverage multi-threading and async programming for concurrent operations
β
Validate and serialize data with Pydantic
β
Integrate with external APIs efficiently
β
Write comprehensive test suites with pytest
β
Perform file and OS operations across platforms
| Concept | Chapter | Why Important |
|---|---|---|
| OOP Design | 1 | Foundation for scalable code |
| Inheritance | 2 | Code reuse and structure |
| Polymorphism | 3 | Flexible, extensible systems |
| Multi-Threading | 4 | Concurrent I/O operations |
| Data Validation | 5 | Data quality and integrity |
| Async/Await | 6 | High-performance I/O |
| API Integration | 7 | Data ingestion and services |
| Testing | 8 | Code reliability and maintenance |
| File Operations | 9 | Data handling and persistence |
- Official Python Documentation
- Pydantic Documentation
- AsyncIO Documentation
- Pytest Documentation
- Real Python Articles
- Each chapter is self-contained but builds on foundational OOP concepts from Chapter 1
- Sample data files are provided for practical exercises
- All code examples are tested and production-ready patterns
- The tutorial emphasizes practical application over pure theory
Ensure all dependencies are installed:
pip install -r requirements.txtInstall Jupyter:
pip install jupyter notebookMake sure you're in the correct directory and all files are in place.
This is a comprehensive tutorial designed for professional development. If you find any issues or have suggestions for improvements, please review the code examples and refer to the official documentation of each library.
Last Updated: April 2026
Python Version: 3.8+
License: Educational Use