Learn Python - Free Tutorials & AI Guides

Free Python Tutorials, AI Guides & Coding Projects

Python Workflow Orchestration
Temporal Python SDK Source Tour: Durable Workflows in Real Python Code

Temporal Python SDK Source Tour: Durable Workflows in Real Python Code

Every Python service eventually grows the same organ: a retry loop wrapped around a database table wrapped around a while True that tracks what already happened. The code starts as a simple async def, then acquires manual checkpoints, a status...

Python Workflow Orchestration
Snakemake Source Tour: The Parser, DAG, and Scheduler Behind Reproducible Runs

Snakemake Source Tour: The Parser, DAG, and Scheduler Behind Reproducible Runs

Most data teams do not lose time writing analysis code. They lose time explaining, months later, why a directory of outputs cannot be regenerated. A script grew a for loop, the loop grew a shell call, the shell call grew...

Python Workflow Orchestration
Prefect Source Tour: How a Python @flow Becomes an Orchestrated Run

Prefect Source Tour: How a Python @flow Becomes an Orchestrated Run

You write a function, put @flow on top, and call it. Something inside the process creates a run record, proposes a state to a server, catches a retry, persists a result, and stamps a timestamp you never asked for. That...

Python Workflow Orchestration
Luigi Source Tour: Inside Spotify's Python Workflow Orchestrator

Luigi Source Tour: Inside Spotify's Python Workflow Orchestrator

Every data team eventually writes the same script twice: once to compute something, and once to figure out whether it already ran. Nightly jobs spawn dependencies, a retry silently recomputes a week of output, and the only source of truth...

Python Workflow Orchestration
Kedro Source Tour: How KedroSession and a Lazy Data Catalog Execute a Reproducible DAG

Kedro Source Tour: How KedroSession and a Lazy Data Catalog Execute a Reprodu...

Every data team eventually owns a folder of scripts that used to work. One reads a CSV from someone’s desktop, another writes a pickle to a path that no longer exists, and the only record of what ran is a...

Python Workflow Orchestration
Invoke Source Tour: How @task Turns Python Functions Into a CLI Task Runner

Invoke Source Tour: How @task Turns Python Functions Into a CLI Task Runner

Every Python repository that survives long enough grows a scripts/ directory. First it holds one deploy.sh, then a Makefile with seven phony targets, then a README paragraph that begins with “run this from the project root, but only on macOS”....

Python Workflow Orchestration
Flyte Source Tour: Typed Interfaces, Python Bindings, and the TaskAction Reconciler

Flyte Source Tour: Typed Interfaces, Python Bindings, and the TaskAction Reco...

Every Python team that runs work in production eventually hits the same wall: the function that trains a model is easy to write, but the contract around it is not. Which arguments are required, what type each one has, who...

Python Workflow Orchestration
doit Source Tour: How a Python Task Runner Decides What to Run

doit Source Tour: How a Python Task Runner Decides What to Run

Every repository eventually grows a scripts/ folder: a shell script that regenerates fixtures, another that versions a wheel, a third that nobody dares delete because the release notes depend on it. The usual fix is a Makefile nobody reads or...

Python Workflow Orchestration
Dagster Source Tour: From @asset to a Resolved ExecutionPlan

Dagster Source Tour: From @asset to a Resolved ExecutionPlan

It is a familiar 3 a.m. question: the nightly job turned red, but nobody can say which table is now stale, which step was skipped, and which output was silently half-written. Generic task runners answer “did the function return?” They...

Python Workflow Orchestration
Apache Beam Python SDK Source Tour: PCollection, ParDo, and the DAG Container

Apache Beam Python SDK Source Tour: PCollection, ParDo, and the DAG Container

You have a batch job that reads thousands of CSV shards, joins them against a small dimension table, and writes partitioned output. It works fine locally. Then someone asks for the same logic on a cluster, then for a streaming...

Python Data Validation
Voluptuous Source Tour: How a Python Validation Library Compiles Plain Dicts Into Validators

Voluptuous Source Tour: How a Python Validation Library Compiles Plain Dicts ...

Every Python service that ingests structured data eventually hits the same wall: the config file loads, the API payload parses, and then the code crashes deep inside some accessor because a field that was supposed to exist simply is not...

Python Data Validation
typeguard Source Tour: Runtime Type Checking That Recompiles Your Python

typeguard Source Tour: Runtime Type Checking That Recompiles Your Python

Type hints are wonderful documentation, and mypy turns them into a genuine static safety net. But the moment data crosses a boundary you do not control — a JSON payload, a CSV row, a third-party SDK return value — every...

Python Data Serialization
orjson Source Tour: How the Fastest Python JSON Library Is Built in Rust

orjson Source Tour: How the Fastest Python JSON Library Is Built in Rust

Every Python service serializes JSON somewhere in its hot path, and every team eventually hits the same wall: the standard library’s json module is flexible but slow, while the “fast” replacements that proliferated in the 2010s were fast partly by...

Python Data Serialization
msgspec Source Tour: One C File Behind Python's Typed JSON and MessagePack

msgspec Source Tour: One C File Behind Python's Typed JSON and MessagePack

Every Python developer has felt the friction msgspec removes. json.loads returns dicts and strings, and your code then spends twenty lines reassembling them into the dataclasses you actually wanted. Validate with a heavyweight library and you pay for safety on...

Python Data Serialization
msgpack-python Source Tour: The Cython Core, the Pure-Python Fallback, and One Timestamp Class

msgpack-python Source Tour: The Cython Core, the Pure-Python Fallback, and On...

Every Python developer who has pushed a cache, shipped telemetry between microservices, or exchanged records with a non-Python service has hit the same wall. JSON is verbose, slow to parse at volume, and cannot tell a bytes value from a...

Python Data Validation
How marshmallow Works: A Source Tour of Python's Schema Serialization Library

How marshmallow Works: A Source Tour of Python's Schema Serialization Library

Every backend eventually hits the same wall: raw JSON arrives from a client, and the code that consumes it needs typed, trustworthy Python objects. Hand-rolled checks — if "name" in payload, int(payload["age"]), another try/except for the email regex — start...

Python Data Validation
python-jsonschema Source Tour: How validate(), create() and best_match Actually Work

python-jsonschema Source Tour: How validate(), create() and best_match Actual...

Every Python developer who has glued two services together has met jsonschema at the worst possible moment: a config file passes one check, an OpenAPI document passes another, and then production rejects a payload with a ValidationError that mentions a...

Python Data Serialization
cattrs Source Tour: How Python attrs Serialization Gets Fast

cattrs Source Tour: How Python attrs Serialization Gets Fast

Every service with a typed core eventually hits the same wall: the objects you trust inside the process are not the objects the network hands you. A payload arrives as JSON, your code wants an attrs class, and somebody has...

Python Data Validation
beartype Source Tour: How Python's O(1) Runtime Type Checker Compiles Your Hints

beartype Source Tour: How Python's O(1) Runtime Type Checker Compiles Your Hints

Every Python codebase has one: the function annotated as taking list[int] that, at 2 a.m., receives a list of strings parsed out of a JSON payload. The static checker saw a clean call site and approved it. The runtime never...

Python Data Validation
attrs Source Tour: Inside the Code Generator Behind Python's Data Classes

attrs Source Tour: Inside the Code Generator Behind Python's Data Classes

Every Python developer has written the same class a hundred times: an __init__ that assigns three arguments to self, a __repr__ that someone forgot to update, an __eq__ that compares the wrong fields, and a __hash__ that was silently broken...

Python Concurrency
uvloop Source Tour: How Cython and libuv Rewire asyncio's Event Loop

uvloop Source Tour: How Cython and libuv Rewire asyncio's Event Loop

If you have ever profiled a busy Python service and watched the bulk of CPU time go to scheduling rather than to your handlers, you already know the cheapest speed-up available: swap the event loop. The project people swap to...

Python Concurrency
Trio Source Tour: How Python's Structured Concurrency Library Really Works

Trio Source Tour: How Python's Structured Concurrency Library Really Works

If you have ever maintained a nontrivial asyncio codebase, you know the quiet failures. A task is spawned without anyone keeping a reference, and the garbage collector eats it mid-flight. An exception surfaces three layers away from the bug. A...

Python Concurrency
RQ Source Tour: How Redis Queue Executes Python Background Jobs

RQ Source Tour: How Redis Queue Executes Python Background Jobs

Your web handler has just spent nine seconds emailing three hundred users, and the request timeout is ten. Every Python team eventually hits the same wall: some work is too slow, too flaky, or too bursty to live inside a...

Python Concurrency
huey Source Tour: Inside the Zero-Dependency Python Task Queue

huey Source Tour: Inside the Zero-Dependency Python Task Queue

Every Python team eventually hits the same wall: a background job that outgrows a thread. A webhook needs a retry, a nightly report needs cron semantics, a bulk import needs to run “later” without blocking a request — and suddenly...

Watch PyShine on YouTube