Tag Archives: #python

Testing Python Applications with pytest: Patterns for Real Code

Testing Python Applications with pytest: Patterns for Real Code

Unit, integration, and end-to-end tests, why pytest beats unittest, and how mocks, fixtures, setup, teardown, and test independence work in a FastAPI project.

Continue Reading
Async, Background Tasks, and Error Handling in FastAPI

Async, Background Tasks, and Error Handling in FastAPI

Async I/O, fire-and-forget background tasks, a shared httpx client, and three global exception handlers in FastAPI — grounded in the FastURL project.

Continue Reading
Layered Architecture with FastAPI: Routers, Services, and Repositories

Layered Architecture with FastAPI: Routers, Services, and Repositories

Learn how to structure a production-ready FastAPI project using a layered architecture: Routers, Services, Repositories, and Dependency Injection.

Continue Reading
From Domain Design to REST API: Building FastURL with FastAPI

From Domain Design to REST API: Building FastURL with FastAPI

Learn how to turn requirements and a domain model into a clean REST API using FastAPI and Pydantic v2, using FastURL — a URL shortener — as a concrete case study.

Continue Reading
Designing REST APIs in Practice: A Kubernetes Case Study

Designing REST APIs in Practice: A Kubernetes Case Study

Learn how to design robust, domain-driven REST APIs using HTTP semantics and clean architecture principles, using Kubernetes as a practical case study.

Continue Reading
Async and the Event Loop in Python: asyncio in Practice

Async and the Event Loop in Python: asyncio in Practice

Build a real async news aggregator step by step — fetching RSS feeds concurrently with aiohttp, the same code used in the Alfred open-source project. Each section adds one asyncio pattern: gather, TaskGroup, timeout, Semaphore, and format_news.

Continue Reading
Concurrency in Python: Threads, Processes, and the Event Loop

Concurrency in Python: Threads, Processes, and the Event Loop

Master Python concurrency: understand when to use threads, processes, or asyncio — and why the event loop became the backbone of modern high-throughput applications.

Continue Reading