A curated collection of Python learning roadmaps, real-world project blueprints, hands-on code examples, exercises, and accredited course tracks on Lucebra.
- Interactive Python Learning Roadmap
- Core Fundamentals & Syntax Cheat Sheet
- Hands-On Code Examples
- Graded Project Blueprints
- Curated Learning Resources & Accredited Courses
- Contributing Guidelines
flowchart TD
subgraph Phase1["Phase 1: Foundations (Weeks 1-4)"]
A1[Syntax, Variables & Data Types] --> A2[Control Flow, Loops & Functions]
A2 --> A3[Data Structures: Lists, Dicts, Sets, Tuples]
A3 --> A4[File I/O, Error Handling & Virtual Environments]
end
subgraph Phase2["Phase 2: Intermediate & OOP (Weeks 5-8)"]
B1[OOP: Classes, Inheritance, Dunder Methods] --> B2[Decorators, Generators & Context Managers]
B2 --> B3[Type Hints, Pydantic & Data Validation]
B3 --> B4[Testing: pytest & Unit Testing]
end
subgraph Phase3["Phase 3: Web APIs & Microservices (Weeks 9-12)"]
C1[HTTP Fundamentals & RESTful Design] --> C2[FastAPI & AsyncIO]
C2 --> C3[SQLAlchemy ORM, PostgreSQL & Migrations]
C3 --> C4[Dockerization & JWT Authentication]
end
subgraph Phase4["Phase 4: AI Engineering & Production (Weeks 13+)"]
D1[LangChain, LlamaIndex & Vector DBs] --> D2[OpenAI / Anthropic APIs & RAG Pipelines]
D2 --> D3[Celery Background Workers & Redis]
D3 --> D4[CI/CD, AWS Deployment & Observability]
end
Phase1 --> Phase2
Phase2 --> Phase3
Phase3 --> Phase4
def parse_response(status_code: int) -> str:
match status_code:
case 200:
return "OK: Request processed successfully"
case 400 | 422:
return "Client Error: Invalid payload supplied"
case 401 | 403:
return "Auth Error: Unauthorized access"
case 500:
return "Server Error: Internal system failure"
case _:
return f"Unknown status code: {status_code}"from contextlib import contextmanager
import time
@contextmanager
def execution_timer(task_name: str):
start = time.perf_counter()
try:
yield
finally:
elapsed = time.perf_counter() - start
print(f"[{task_name}] Completed in {elapsed:.4f}s")from fastapi import FastAPI, HTTPException, status
from pydantic import BaseModel, Field
from typing import List
import uvicorn
app = FastAPI(
title="Lucebra Python Microservice",
description="High-performance async REST API with Pydantic validation",
version="1.0.0"
)
class CourseCatalogItem(BaseModel):
id: str = Field(..., example="py-101")
title: str = Field(..., min_length=5, max_length=100)
instructor: str = Field(..., example="Educational Engineering Team")
students_enrolled: int = Field(default=0, ge=0)
is_certified: bool = True
courses_db: List[CourseCatalogItem] = []
@app.get("/api/v1/courses", response_model=List[CourseCatalogItem])
async def list_courses():
return courses_db
@app.post("/api/v1/courses", status_code=status.HTTP_201_CREATED)
async def create_course(course: CourseCatalogItem):
if any(c.id == course.id for c in courses_db):
raise HTTPException(status_code=400, detail="Course ID already exists")
courses_db.append(course)
return {"message": "Course created successfully", "course": course}
if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)from abc import ABC, abstractmethod
from typing import Optional
class BaseRepository(ABC):
@abstractmethod
def get_by_id(self, entity_id: str) -> Optional[dict]:
pass
@abstractmethod
def save(self, entity: dict) -> bool:
pass
class InMemoryCourseRepository(BaseRepository):
def __init__(self):
self._storage = {}
def get_by_id(self, entity_id: str) -> Optional[dict]:
return self._storage.get(entity_id)
def save(self, entity: dict) -> bool:
self._storage[entity["id"]] = entity
return Trueimport os
from openai import OpenAI
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
def generate_lesson_summary(topic: str, target_language: str = "en") -> str:
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{
"role": "system",
"content": f"You are an expert academic tutor. Summarize concepts clearly in {target_language}."
},
{
"role": "user",
"content": f"Provide an executive summary and 3 key takeaways for: {topic}"
}
],
temperature=0.3,
max_tokens=350
)
return response.choices[0].message.content| Level | Project Title | Key Technologies | Expected Deliverable |
|---|---|---|---|
| Beginner | CLI Personal Budget & Expense Tracker | sys, json, argparse |
Interactive terminal application with CSV/JSON persistence |
| Intermediate | Asynchronous Web Scraper & Price Monitor | httpx, asyncio, BeautifulSoup |
Monitors e-commerce prices with automated webhook alerts |
| Advanced | Full-Stack Course Analytics API | FastAPI, PostgreSQL, Docker |
Multi-tenant REST API with JWT auth and rate limiting |
| Expert | RAG-Powered AI Knowledge Base | LangChain, ChromaDB, OpenAI |
Semantic document search answering queries from uploaded PDFs |
- Official Python Tutorial β The canonical documentation.
- FastAPI Official Tutorial β Type-safe modern web APIs.
- Real Python β High-quality community tutorials and guides.
- π Python AI & GPT-3/4 Engineering: Zero to Hero with GPT-3 & Python β Practical Python automation, OpenAI SDK integration, and verifiable digital certificate.
- β‘ Embedded Systems with MicroPython: Educational Engineering Team Courses β 2M+ students, microcontroller control via Python.
- πΌ CIO & IT Strategy for Tech Leaders: Peter Alkema Executive Tracks β Enterprise IT management and AI adoption.
We welcome community contributions! To add tutorials, exercises, or code samples:
- Fork this repository.
- Create your feature branch (
git checkout -b feature/new-python-exercise). - Ensure all Python code is formatted with
blackand passesflake8. - Submit a descriptive Pull Request referencing your enhancements.
Distributed openly under CC0-1.0 by Lucebra Global Education (www.lucebra.com)