Intermediate Python & Clean Code
Level up from Python basics to production-ready software design: 16 progressive lessons across 6 modules covering comprehensions, collections, generators, decorators, dataclasses, context managers, pathlib, regex, logging, asyncio, pytest fixtures/mocking, and a CLI pipeline capstone.
Course Syllabus
1. Pythonic Data Structures & Comprehensions
0/2 done- 6 min
1. Dict & Set Comprehensions, Generator Expressions & Star Unpacking
Write expressive, idiomatic Python transformations using dictionary and set comprehensions, memory-saving generator expressions, zip(), and extended star unpacking.
- 5 min
2. The collections Module: Counter, defaultdict, deque & NamedTuple
Stop reinventing frequency counters, nested grouping dicts, and fixed-size queues—use Python's built-in collections and typing.NamedTuple power tools.
2. Iterators, Generators & Functional Tools
0/4 done- 5 min
3. Iterators, Lazy Evaluation & yield Generators
Understand how Python's iterator protocol powers every for loop, and write memory-efficient streaming pipelines using generator functions, yield, and yield from.
- 5 min
4. First-Class Functions, Closures & Decorators
Learn how functions work as objects in Python, how closures remember enclosing state, and how to write clean decorators with @functools.wraps and optional parameters.
- 5 min
5. Functional Superpowers: functools & itertools
Speed up repeated calls with @lru_cache, specialize functions with partial(), and slice, chain, or combine iterables cleanly using Python's itertools module.
- 4 min
6. Practice Lab 1: Streaming Pipelines & Custom Decorators
Put Modules 1 and 2 into action: build a lazy generator pipeline with Counter/defaultdict and write reusable decorators tested with automated assert checks.
3. Modern OOP, Dataclasses & Context Managers
0/3 done- 4 min
7. Modern Data Modeling: @dataclass, Enum & Advanced Type Hints
Eliminate class boilerplate with @dataclass, replace error-prone magic strings using Enum, and write flexible static contracts with Union, Literal, Callable, and Protocol.
- 4 min
8. Python Data Model: Dunder Methods & @property
Make custom Python classes feel like built-in types using dunder methods (__repr__, __str__, __len__, __getitem__, __iter__) and validate attributes cleanly with @property.
- 4 min
9. Context Managers (with) & Custom Resource Safety
Understand how Python's with statement guarantees cleanup even when crashes happen, and build your own context managers using __enter__/__exit__ and @contextlib.contextmanager.
4. Essential Standard Library for Real Projects
0/4 done- 5 min
10. Modern File & Directory Automation with pathlib
Replace clunky os.path string joining with Python's object-oriented pathlib.Path: join paths cleanly with /, search folders with glob/rglob, and automate file workflows safely.
- 5 min
11. Text Extraction & Validation with Regular Expressions (re)
Extract structured fields from messy logs, validate formats, and clean text reliably using Python's re module, raw strings, named capture groups, and compiled patterns.
- 5 min
12. Dates, Timezones (datetime) & Production logging
Avoid subtle timezone bugs with UTC-aware datetime objects, compute durations with timedelta, and replace messy print() statements with Python's structured logging module.
- 5 min
13. Practice Lab 2: Log Parser with Regex, Dataclasses & Pathlib
Combine Modules 3 and 4 in a realistic lab: build a frozen @dataclass LogEntry with an Enum level, parse raw server logs using compiled regex, and save a JSON summary via pathlib.
5. Concurrency, Testing & Code Quality
0/2 done- 5 min
14. Concurrency Demystified: Threading, Multiprocessing & asyncio
Know exactly when to use threads, processes, or async/await in Python: understand I/O-bound vs CPU-bound work, the GIL, ThreadPoolExecutor, and concurrent asyncio.gather().
- 5 min
15. Intermediate pytest: Fixtures, Parametrize, Mocking & Code Quality
Write clean, scalable test suites with pytest fixtures, @pytest.mark.parametrize, monkeypatch/unittest.mock, and keep projects spotless with ruff and mypy.
Earn Your Intermediate Python & Clean Code Certificate
Take the final assessment once you finish the lessons. Score 70% or higher to unlock a printable completion certificate.
Quick Reference
Intermediate Python Cheat Sheet
Quick reference for Intermediate Python: dict/set comprehensions, Counter/defaultdict/deque, yield generators, decorators, @dataclass, Enum, contextlib, pathlib, regex, logging, asyncio, and pytest.
What Next?
Explore Career Learning Roadmaps
See how this course connects with Python, SQL, Git, and Web Development paths.