Complete Python SDK reference for the Anthropic Claude API β messages, streaming, vision, extended thinking, prompt caching, batch processing, and token counting.
Installation guides, essential packages, CLI snippets, and real-world recipes for Python 3.
Write concurrent Python code with asyncio. Covers coroutines, asyncio.run, gather, create_task, timeouts, queues, and avoiding the blocking-call pitfall.
Format Python code consistently with black. Covers installation, configuration, editor integration, and how it compares to ruff format.
Short standalone Python scripts for common tasks β file I/O, JSON manipulation, HTTP requests, CSV processing, and data transformation.
Build command-line interfaces with click using decorators. Covers commands, options, arguments, groups, prompts, and progress bars.
Build database-driven web applications with Django. Covers project setup, models, migrations, the admin panel, views, and the management command workflow.
Overview of the 23 most useful Python packages β HTTP clients, data science, web frameworks, testing, and tooling. Each has its own dedicated page with examples.
Build high-performance async REST APIs with FastAPI. Covers path params, request bodies, Pydantic models, dependency injection, and auto-generated OpenAPI docs.
Build lightweight web apps and REST APIs with Flask. Covers routes, request handling, JSON responses, blueprints, and the debug-server warning.
Make sync and async HTTP requests with httpx. Covers GET/POST, async usage, HTTP/2, streaming, and how it compares to requests.
Choose your OS and get Python installed in minutes. Covers Windows, WSL/Ubuntu, macOS, and Linux with recommended versions and verification steps.
Install Python 3 on Debian/Ubuntu, Fedora/RHEL, and Arch Linux. Covers package managers, pyenv, and building from source for unsupported distros.
Install Python 3 on macOS via Homebrew or pyenv. Explains the system-Python warning, PATH precedence, and verification steps.
Install Python 3 on Windows via winget or the python.org installer. Covers PATH setup, the py launcher, and verification steps.
Install Python 3 inside WSL2/Ubuntu via apt, the deadsnakes PPA, or pyenv. Covers the python3-venv quirk and version aliasing.
Run interactive Python notebooks with Jupyter. Covers JupyterLab setup, cell types, keyboard shortcuts, magic commands, nbconvert export, and common pitfalls.
Add structured, colorized logging to Python apps with loguru. Covers sinks, log levels, file rotation, retention, exception catching, and context binding.
Create publication-quality 2-D plots with matplotlib. Covers pyplot basics, subplots, savefig, common chart types, and the show-vs-save pitfall.
Catch type errors before runtime with mypy. Covers strict mode, common error codes, type: ignore annotations, gradual typing, and pyproject.toml configuration.
Create and manipulate N-dimensional arrays with NumPy. Covers array creation, broadcasting, vectorized math, indexing, and matrix operations.
Useful Python one-liners runnable directly from the shell with python -c or python -m. No file creation needed.
Load, filter, transform, and aggregate tabular data with pandas. Covers DataFrame creation, read_csv, groupby, merge, and the SettingWithCopy pitfall.
Work with filesystem paths using Python's built-in pathlib module. Covers Path creation, navigation, reading/writing files, glob patterns, and stat.
Open, resize, crop, convert, and save images with Pillow (PIL fork). Covers format conversion, filters, drawing, and EXIF handling.
Manage Python project dependencies, virtual environments, and package publishing with Poetry. Covers pyproject.toml, lockfiles, groups, and publishing to PyPI.
Validate and parse data at runtime using Python type hints with Pydantic v2. Covers BaseModel, field validators, nested models, and JSON serialization.
Write and run Python tests with pytest. Covers test discovery, assertions, fixtures, parametrize, conftest, and common patterns.
Make HTTP requests in Python with the requests library. Covers GET/POST, JSON, sessions, authentication, retries, and common pitfalls.
Make terminal output beautiful with Rich. Covers styled print, Console, tables, progress bars, syntax highlighting, live displays, and the rich-cli command.
Lint and format Python code with ruff β a single Rust-powered tool that replaces flake8, isort, and black. Covers configuration, rule selection, and CI usage.
Statistical distributions, optimization, integration, signal processing, and linear algebra with SciPy. Builds on NumPy arrays.
Connect to databases, write queries, and define ORM models with SQLAlchemy 2.0. Covers the engine, sessions, Core queries, ORM declarative models, and the N+1 pitfall.
Install packages and manage virtual environments blazingly fast with uv. Covers uv pip, uv venv, uv run, uv init, and how it compares to pip and poetry.
Create, activate, and manage Python virtual environments with venv. Covers activation for every shell, pip usage, requirements files, and cleanup.
navigation
actions
cheat sheet pages