Back to blog
Backend Systemsbeginner

Python 12-Week Curriculum: Detailed Beginner to Expert Tutorial

A detailed, day-by-day 12-week Python curriculum with weekly goals, practical assignments, projects, test checkpoints, and capstone guidance.

Asma HafeezMay 6, 202620 min read
pythonpython curriculumpython roadmappython tutorialbeginner to expertfastapipytestasynciobackend
Share:𝕏

Python 12-Week Curriculum: Detailed Beginner to Expert Tutorial

This curriculum is designed for consistent, practical learning.
Study 60-90 minutes daily and ship code every week.

How to Use This Curriculum

  • Study 6 days per week and reserve 1 day for review/project polish
  • Keep one Git repository for all weekly work
  • Write a short daily log with: what you learned, what failed, what you fixed
  • Commit at least once per day with meaningful messages

Daily Study Structure (60-90 minutes)

  1. 10 min: revise prior notes
  2. 20-30 min: learn one core concept
  3. 30-40 min: implement one practical task
  4. 10 min: debug + write learning log

Week 1: Python Foundations

Goal: Become comfortable writing basic scripts from scratch.

Day-by-Day Plan

  • Day 1: Install Python, set up editor, run first script
  • Day 2: Variables, data types, casting, f-strings
  • Day 3: Input/output and arithmetic operations
  • Day 4: Conditionals and boolean logic
  • Day 5: Loops and loop control statements
  • Day 6: Practice problems (minimum 20)
  • Day 7: Build Calculator CLI

Assignment

Build a CLI calculator with:

  • add, subtract, multiply, divide
  • invalid-input handling
  • divide-by-zero protection

Done Criteria

  • App handles invalid input without crashing
  • Logic is split into small functions
  • Output is clear for non-technical users

Week 2: Data Structures and Functions

Goal: Learn to represent and transform data effectively.

Day-by-Day Plan

  • Day 1: Lists and common list operations
  • Day 2: Tuples, sets, dictionaries
  • Day 3: Functions, parameters, return values
  • Day 4: *args, **kwargs, variable scope
  • Day 5: Comprehensions
  • Day 6: Practice problems (collections + functions)
  • Day 7: Build Expense Tracker

Assignment

Build an expense tracker that:

  • stores expenses by category
  • calculates daily/weekly totals
  • shows top expense categories

Done Criteria

  • Uses dict/list appropriately
  • Has reusable helper functions
  • No repeated logic blocks over 5 lines

Week 3: Files and Error Handling

Goal: Persist data and build fault-tolerant scripts.

Day-by-Day Plan

  • Day 1: File reading/writing with context managers
  • Day 2: JSON and CSV operations
  • Day 3: try/except/finally patterns
  • Day 4: Input validation and custom exceptions
  • Day 5: Modules and imports
  • Day 6: Refactor old scripts into modules
  • Day 7: Build To-Do CLI with JSON persistence

Assignment

Build a task manager CLI with commands:

  • add task
  • list tasks
  • complete task
  • delete task

Done Criteria

  • Data persists across app restarts
  • Corrupt/missing files are handled gracefully
  • Error messages are actionable

Week 4: Object-Oriented Python

Goal: Model real-world systems with classes and objects.

Day-by-Day Plan

  • Day 1: Class basics and constructors
  • Day 2: Instance vs class attributes
  • Day 3: Encapsulation with properties
  • Day 4: Inheritance and polymorphism
  • Day 5: Composition and design tradeoffs
  • Day 6: OOP practice set
  • Day 7: Refactor To-Do CLI into OOP design

Assignment

Create Task and TaskManager classes with:

  • status transitions
  • filtering/sorting
  • validation rules

Done Criteria

  • Classes have single responsibilities
  • Public API methods are clear and consistent
  • Internal state is protected where needed

Week 5: Testing and Code Quality

Goal: Write reliable code with automated checks.

Day-by-Day Plan

  • Day 1: pytest basics and test layout
  • Day 2: Parametrized tests and fixtures
  • Day 3: Test edge cases and negative scenarios
  • Day 4: Linting with ruff
  • Day 5: Formatting with black
  • Day 6: Logging basics (logging)
  • Day 7: Quality pass on all previous projects

Assignment

Add tests to your To-Do/Expense projects for:

  • valid operations
  • invalid input
  • edge cases

Done Criteria

  • Core logic has tests
  • Quality commands all pass:
Bash
ruff check .
black --check .
pytest -q

Week 6: SQL and API Basics

Goal: Work with external data and persistent storage.

Day-by-Day Plan

  • Day 1: SQL fundamentals (SELECT, WHERE, ORDER BY)
  • Day 2: Joins and relational modeling
  • Day 3: sqlite3 integration with Python
  • Day 4: REST basics (methods/status codes)
  • Day 5: Consume APIs with requests
  • Day 6: Store API data in SQLite
  • Day 7: Build reporting script from stored data

Assignment

Build a small data collector:

  • fetch from a public API
  • store results in SQLite
  • print useful summary analytics

Done Criteria

  • Database schema is documented
  • Queries are parameterized
  • API errors and timeouts are handled

Week 7: FastAPI Foundations

Goal: Build a structured backend service.

Day-by-Day Plan

  • Day 1: FastAPI app setup and routing
  • Day 2: Pydantic request/response models
  • Day 3: CRUD endpoint implementation
  • Day 4: Database integration
  • Day 5: Service layer extraction
  • Day 6: API tests
  • Day 7: Release Task API v1

Assignment

Build a task API with endpoints to:

  • create tasks
  • list/filter tasks
  • update status
  • delete tasks

Done Criteria

  • OpenAPI docs are clean
  • Validation errors are clear
  • Endpoints are covered by tests

Week 8: Security and Deployment Basics

Goal: Add production-ready safeguards.

Day-by-Day Plan

  • Day 1: Auth concepts (JWT/session)
  • Day 2: Add authentication to API
  • Day 3: Password hashing and secrets handling
  • Day 4: Authorization rules
  • Day 5: Dockerize API
  • Day 6: Add environment-based configuration
  • Day 7: Release Task API v2 (auth + Docker)

Assignment

Secure the API with:

  • protected routes
  • role checks for admin operations
  • safe secret management

Done Criteria

  • Unauthorized access is blocked
  • Secrets are not hardcoded
  • API runs locally through Docker

Week 9: Advanced Python Tools

Goal: Write expressive and efficient Python.

Day-by-Day Plan

  • Day 1: Generators and lazy evaluation
  • Day 2: Decorators and @wraps
  • Day 3: Context managers
  • Day 4: dataclass, Enum, advanced typing
  • Day 5: Functional utilities (itertools)
  • Day 6: Refactor old code with advanced features
  • Day 7: Publish utility module locally

Assignment

Implement:

  • one generator pipeline
  • one reusable decorator
  • one custom context manager

Done Criteria

  • Reduced memory usage for large data flow
  • Decorator preserves metadata
  • Resource cleanup is exception-safe

Week 10: Async and Concurrency

Goal: Improve throughput for I/O-heavy tasks.

Day-by-Day Plan

  • Day 1: Async mental model and event loop
  • Day 2: asyncio.gather and task orchestration
  • Day 3: Timeout/cancellation handling
  • Day 4: Threads vs processes vs async decisions
  • Day 5: Retry/backoff strategies
  • Day 6: Build async data ingestor
  • Day 7: Benchmark sync vs async

Assignment

Build a multi-source async fetch pipeline that:

  • fetches concurrently
  • retries transient failures
  • logs failures with context

Done Criteria

  • Async version is measurably faster for I/O work
  • No silent task failures
  • Logs make troubleshooting easy

Week 11: Performance and Architecture

Goal: Use metrics to improve design and speed.

Day-by-Day Plan

  • Day 1: Profile with cProfile and timeit
  • Day 2: Data-structure performance tuning
  • Day 3: Caching strategy basics
  • Day 4: Layered architecture patterns
  • Day 5: Modular packaging strategy
  • Day 6: Refactor for maintainability
  • Day 7: Technical review and cleanup

Assignment

Choose one project and:

  • profile it
  • optimize one bottleneck
  • document architectural decisions

Done Criteria

  • Optimization is benchmark-backed
  • Codebase is easier to navigate
  • Architecture notes explain tradeoffs

Week 12: Capstone and Interview Readiness

Goal: Deliver a portfolio-quality project and explain it clearly.

Day-by-Day Plan

  • Day 1: Scope capstone and write architecture outline
  • Day 2: Implement core modules
  • Day 3: Add automated tests
  • Day 4: Add logging and robust error handling
  • Day 5: Docker + CI integration
  • Day 6: Polish docs and usage examples
  • Day 7: Prepare project walkthrough + interview stories

Assignment

Complete one capstone:

  • production task manager API
  • async job processor
  • CLI + backend productivity suite

Done Criteria

  • Project runs from README instructions only
  • CI passes with tests and checks
  • You can explain architecture and tradeoffs in 5-10 minutes

Detailed Planning Layer (What to Do Every Week)

Use this planning layer with the 12-week schedule above.
It gives you exact execution structure so every week has clear output.

Weekly Planning Template (Repeat for Weeks 1-12)

At the start of each week, define:

  1. Learning target: one primary technical focus
  2. Build target: one feature/project outcome
  3. Quality target: tests/lint/docs milestone
  4. Review target: one retrospective note on mistakes and improvements

Daily Execution Template (Mon-Sat)

  • Day A (Concept): learn core idea + write 10-line summary
  • Day B (Implementation): build first working version
  • Day C (Refactor): improve structure and readability
  • Day D (Validation): add tests + error handling
  • Day E (Performance/Quality): optimize and run checks
  • Day F (Publish): push code + write progress note

Sunday Review (Mandatory)

  • Review all commits from the week
  • List top 3 bugs and how you fixed them
  • Write next week's risk list
  • Decide one improvement to carry forward

Week-by-Week Detailed Planning Targets

Week 1 Planning Targets

  • Learning target: syntax fluency without copy-paste
  • Build target: calculator CLI with robust validation
  • Quality target: no crash on invalid input
  • Publish target: README with usage examples

Week 2 Planning Targets

  • Learning target: choose right data structures fast
  • Build target: expense tracker with categories + summaries
  • Quality target: remove duplicate logic with helper functions
  • Publish target: before/after refactor commit comparison

Week 3 Planning Targets

  • Learning target: persistence + fault-tolerant scripts
  • Build target: JSON-backed to-do manager
  • Quality target: graceful handling of corrupt/missing files
  • Publish target: sample data file + recovery behavior docs

Week 4 Planning Targets

  • Learning target: OOP modeling and clean boundaries
  • Build target: Task + TaskManager class architecture
  • Quality target: methods with clear responsibilities
  • Publish target: class diagram or architecture note

Week 5 Planning Targets

  • Learning target: testing mindset and quality workflow
  • Build target: test suite for previous projects
  • Quality target: all checks pass (ruff, black, pytest)
  • Publish target: test report in README

Week 6 Planning Targets

  • Learning target: SQL + API data integration
  • Build target: API-to-SQLite collector script
  • Quality target: parameterized SQL and timeout-safe API calls
  • Publish target: schema + query explanation

Week 7 Planning Targets

  • Learning target: API design with FastAPI
  • Build target: task CRUD API v1
  • Quality target: input validation and test coverage
  • Publish target: OpenAPI docs screenshot + endpoint list

Week 8 Planning Targets

  • Learning target: authentication and deployment basics
  • Build target: secure task API v2 + Docker
  • Quality target: protected routes and env-based config
  • Publish target: Docker run guide + auth flow notes

Week 9 Planning Targets

  • Learning target: advanced Python expression patterns
  • Build target: generator/decorator/context-manager upgrades
  • Quality target: metadata-safe decorators and exception-safe cleanup
  • Publish target: benchmark or memory-usage comparison

Week 10 Planning Targets

  • Learning target: async/concurrency decisions
  • Build target: async multi-source ingestor
  • Quality target: timeout/retry logic with failure logs
  • Publish target: sync vs async runtime comparison

Week 11 Planning Targets

  • Learning target: optimization with evidence
  • Build target: profile + optimize one real bottleneck
  • Quality target: measurable improvement after changes
  • Publish target: mini performance report

Week 12 Planning Targets

  • Learning target: production delivery + communication
  • Build target: portfolio-grade capstone
  • Quality target: CI + tests + docs + Docker all green
  • Publish target: architecture walkthrough + interview story notes

Detailed Deliverables Checklist (Every Week)

  • One working increment merged to main branch
  • One markdown progress report (weekly-progress.md)
  • One short demo artifact (gif/video/screenshots)
  • One list of technical debt items for next week

If you consistently produce these four deliverables, your learning will compound much faster.


Detailed Study Material (Module-Wise + Day-by-Day)

This section gives you concrete study material to follow daily.

Use this format each day:

  1. Study concept notes (20-30 min)
  2. Implement guided code task (30-40 min)
  3. Solve 3-5 practice prompts (15-20 min)
  4. Write 5 bullet recap in your learning log

Module 1: Python Core Foundations (Week 1)

Day 1: Setup and First Program

Study:

  • Python installation, interpreter, script execution
  • virtual environments and dependency isolation

Guided task:

  • create project folder and main.py
  • print user greeting and current date/time

Practice prompts:

  • difference between running from terminal vs IDE
  • why virtual env matters in real projects

Day 2: Variables, Types, and Strings

Study:

  • int, float, str, bool, None
  • type conversion and common input bugs
  • f-string formatting

Guided task:

  • build profile formatter (name, age, score) with type-safe output

Practice prompts:

  • convert invalid numeric input safely
  • format currency and percentages

Day 3: Conditionals and Logic

Study:

  • if/elif/else
  • comparison and logical operators

Guided task:

  • discount calculator with tiered rules

Practice prompts:

  • write guard clauses for invalid values
  • explain and vs or with examples

Day 4: Loops and Loop Patterns

Study:

  • for, while, break, continue

Guided task:

  • menu-driven CLI loop (retry until user exits)

Practice prompts:

  • sum of even numbers range
  • detect first matching value in list

Day 5: Functions

Study:

  • function signatures, return values, default args

Guided task:

  • split calculator operations into separate functions

Practice prompts:

  • when to return vs print
  • design one function with clear single responsibility

Day 6-7: Weekly Build

Build:

  • robust calculator CLI with validation and retries

Submission:

  • README + screenshots + known limitations

Module 2: Data Structures and File Workflows (Weeks 2-3)

Day-by-Day Focus

  • Day 1: lists, tuples, sets, dicts tradeoffs
  • Day 2: comprehensions and transform pipelines
  • Day 3: JSON read/write and schema consistency
  • Day 4: CSV parsing + aggregation
  • Day 5: exceptions and custom error messages
  • Day 6: modularize project (core.py, storage.py, cli.py)
  • Day 7: build JSON-backed To-Do CLI

Guided examples to implement:

  • expense summary by category (dict[str, float])
  • file persistence with backup on write failure
  • graceful recovery for corrupt JSON

Module 3: OOP and Clean Design (Week 4)

Study material

  • class design basics
  • encapsulation with @property
  • composition vs inheritance

Daily implementation track

  • Day 1: Task entity class
  • Day 2: TaskManager service class
  • Day 3: filtering and status transitions
  • Day 4: validation and domain-specific exceptions
  • Day 5: add string representations (__repr__)
  • Day 6-7: refactor CLI to OOP architecture

Module 4: Testing, Quality, and Tooling (Week 5)

Study:

  • pytest test structure
  • fixtures and parametrized tests
  • ruff and black workflow

Day-by-day:

  • Day 1: unit tests for core functions
  • Day 2: negative/edge case tests
  • Day 3: fixtures for reusable setup
  • Day 4: lint and formatting automation
  • Day 5: logging integration
  • Day 6-7: quality sprint on all older modules

Required commands:

Bash
ruff check .
black --check .
pytest -q

Module 5: SQL + APIs + FastAPI (Weeks 6-8)

Week 6 (Data integration)

  • Day 1-2: SQL basics + joins
  • Day 3: SQLite with Python
  • Day 4-5: API consumption with retries/timeouts
  • Day 6-7: build API-to-DB collector

Week 7 (FastAPI core)

  • Day 1: app structure and routing
  • Day 2: request/response models
  • Day 3: CRUD endpoints
  • Day 4: DB integration
  • Day 5: service layer
  • Day 6-7: API test coverage

Week 8 (Security and deploy)

  • Day 1-2: auth concepts and implementation
  • Day 3: secret handling and env config
  • Day 4: authorization rules
  • Day 5-6: Dockerize and run locally
  • Day 7: release API v2

Module 6: Advanced Python and Async (Weeks 9-10)

Study material:

  • generators and lazy pipelines
  • decorators and @wraps
  • context managers
  • asyncio task orchestration

Day-by-day outcomes:

  • build one generator-based ETL flow
  • create one reusable timing decorator
  • implement one custom context manager
  • convert sync API fetcher to async multi-source fetcher
  • benchmark sync vs async runtime

Module 7: Performance, Architecture, and Capstone (Weeks 11-12)

Week 11

  • profile with cProfile and timeit
  • remove one measured bottleneck
  • document architecture tradeoffs

Week 12

  • complete capstone (API/service/CLI+backend)
  • add tests + logging + CI + Docker
  • prepare architecture walkthrough and interview explanation

Capstone must include:

  • reproducible setup
  • test suite
  • deployment instructions
  • technical decision notes

Recommended Supporting Material Per Module

  • Syntax/OOP modules: Python docs + your own mini examples
  • Data modules: Pandas/NumPy tutorials from your resource section
  • API modules: FastAPI official docs + your project code
  • NLP/AI next phase: AI Engineering Roadmap and NLP track articles

The key is depth by module, not random topic switching.


Day-by-Day Study Pack (Weeks 2-12)

Use this pack when you want explicit daily material like Module 1.

Week 2 (Data Structures + Function Thinking)

  • Day 1: Study list/tuple/set/dict tradeoffs; implement one example of each; solve 3 conversion exercises.
  • Day 2: Study list/dict comprehensions; implement filter-map pipelines; solve 5 comprehension tasks.
  • Day 3: Study function contracts (inputs/outputs); refactor repeated code into functions; write 3 pure functions.
  • Day 4: Study *args, **kwargs, defaults; build flexible report function; test with mixed parameters.
  • Day 5: Study mutability side effects; fix one mutable-default bug; write short note on safe patterns.
  • Day 6: Practice set (15-20 problems) on structures and functions.
  • Day 7: Build expense tracker v1 with category summaries.

Week 3 (Files + Errors + Project Structure)

  • Day 1: Study text file I/O with context managers; implement read/write utility.
  • Day 2: Study JSON and CSV serialization; convert one dataset between formats.
  • Day 3: Study exception hierarchy; add try/except handling to previous CLI.
  • Day 4: Study custom validation rules; build input validator module.
  • Day 5: Study module/package organization; split code into core, storage, cli.
  • Day 6: Add robust recovery for missing/corrupt files.
  • Day 7: Ship To-Do CLI v1 with persistent storage.

Week 4 (OOP Design)

  • Day 1: Study class anatomy; create Task model with fields and methods.
  • Day 2: Study manager/service pattern; create TaskManager with CRUD methods.
  • Day 3: Study encapsulation; protect internal state via methods/properties.
  • Day 4: Study inheritance vs composition; refactor one design choice.
  • Day 5: Add representation methods and lightweight domain exceptions.
  • Day 6: Write OOP practice (small domain: library/bank/inventory).
  • Day 7: Refactor To-Do CLI to OOP architecture.

Week 5 (Testing + Quality)

  • Day 1: Study test anatomy; write first unit tests for core logic.
  • Day 2: Add edge/negative tests for bad input and boundary cases.
  • Day 3: Study fixtures and parametrization; reduce test duplication.
  • Day 4: Run and fix linting (ruff) issues across module code.
  • Day 5: Apply formatter (black) and standardize style.
  • Day 6: Add structured logging to key flows.
  • Day 7: Run full quality gate and publish test report.

Week 6 (SQL + API Consumption)

  • Day 1: Study SELECT, filters, sorting; run 10 query drills.
  • Day 2: Study joins and keys; model two related tables.
  • Day 3: Integrate sqlite3 into Python script with parameterized queries.
  • Day 4: Study HTTP basics; call one public API with retries and timeout.
  • Day 5: Parse API payload and validate schema assumptions.
  • Day 6: Persist API data in SQLite and add aggregation query.
  • Day 7: Ship data collector report script.

Week 7 (FastAPI Core)

  • Day 1: Study project layout; scaffold FastAPI app and health endpoint.
  • Day 2: Study Pydantic models; add request/response validation.
  • Day 3: Implement CRUD endpoints for tasks.
  • Day 4: Connect database layer and repositories/services.
  • Day 5: Add error handling and response consistency.
  • Day 6: Write API tests for happy and unhappy paths.
  • Day 7: Ship Task API v1 with docs.

Week 8 (Security + Deployment)

  • Day 1: Study authentication flow concepts (JWT/session).
  • Day 2: Implement auth endpoints and protected routes.
  • Day 3: Study secret handling; move config to environment variables.
  • Day 4: Implement role/policy checks for admin actions.
  • Day 5: Dockerize app and verify local container run.
  • Day 6: Add startup/readiness checks and deployment notes.
  • Day 7: Release Task API v2 (secured + containerized).

Week 9 (Advanced Python Constructs)

  • Day 1: Study generators; convert one list-heavy flow to lazy iteration.
  • Day 2: Study decorators; implement logging/timing decorator with @wraps.
  • Day 3: Study context managers; create custom resource manager.
  • Day 4: Study dataclass, Enum, and advanced typing usage.
  • Day 5: Study itertools; simplify one transformation pipeline.
  • Day 6: Refactor old code with these constructs.
  • Day 7: Publish a reusable utility module.

Week 10 (Async and Concurrency)

  • Day 1: Study event loop model; map sync vs async use cases.
  • Day 2: Implement asyncio.gather for concurrent calls.
  • Day 3: Add cancellation, timeout, and retry strategy.
  • Day 4: Compare async vs threads/processes for one workload.
  • Day 5: Add observability logs for concurrent tasks.
  • Day 6: Build async multi-source ingestor.
  • Day 7: Benchmark and document performance deltas.

Week 11 (Performance + Architecture)

  • Day 1: Profile baseline with cProfile and identify top bottlenecks.
  • Day 2: Optimize data structure/algorithm choice in one hotspot.
  • Day 3: Add caching where read patterns justify it.
  • Day 4: Refactor into layered architecture boundaries.
  • Day 5: Improve package/module organization for maintainability.
  • Day 6: Write technical design notes with tradeoffs.
  • Day 7: Publish performance before/after summary.

Week 12 (Capstone + Interview Readiness)

  • Day 1: Define scope, non-goals, and architecture for capstone.
  • Day 2: Build core domain and API/CLI surface.
  • Day 3: Add unit + integration tests and fix failing paths.
  • Day 4: Add logs, error handling, and validation hardening.
  • Day 5: Add CI pipeline and Docker workflow.
  • Day 6: Finish README, examples, and runbook.
  • Day 7: Prepare 5-10 minute architecture walkthrough + interview story.

Weekly Submission Checklist

Each week submit:

  • One working project increment
  • One short retrospective (what worked / what failed / what changed)
  • Test report (pytest)
  • Quality report (ruff, black)

Final Outcome

After these 12 weeks, you should be able to:

  • Build reliable Python applications from scratch
  • Create and secure backend APIs
  • Test and maintain production-grade code
  • Explain engineering decisions with confidence

What to Learn Next (After Python)

Once you complete this curriculum, the best next step is applied AI engineering:

This roadmap helps you move from strong Python fundamentals into modern AI topics like RAG, agents, evaluation, security, and multimodal systems.

Use this curriculum as a repeatable system, not a one-time reading exercise.

Enjoyed this article?

Explore the Backend Systems learning path for more.

Found this helpful?

Share:𝕏

Leave a comment

Have a question, correction, or just found this helpful? Leave a note below.