Free cheat sheets

Python Cheat Sheets

Quick, compact reference pages for the Python topics you use every day. You can browse each cheat sheet online, or you can download it as a printable PDF. Keep the most useful ones next to your keyboard, or use them as wallpaper behind your desk.

Python Essentials

Real Python Cheat Sheet showing all three pages stacked on top of each other

Python Cheat Sheet

Setup, syntax, data types, variables, strings, control flow, functions, classes, errors, and I/O.

View cheat sheet →
Real Python Python Dev Environment Cheat Sheet pages stacked on top of each other

Python Dev Environment Cheat Sheet

Terminal basics, uv and Python versions, uv projects, editor setup, venv and pip, REPLs and notebooks, Ruff, Git, pytest, and common fixes.

View cheat sheet →
Real Python What's New in Python 3.15 cheat sheet page

Python 3.15 Cheat Sheet

Everyday syntax plus what's new: lazy imports, frozendict, sentinels, unpacking in comprehensions, and UTF-8 by default.

View cheat sheet →
Real Python Decorators Cheat Sheet page with code examples for writing and using decorators

Python Decorators Cheat Sheet

Basic decorators, arguments, functools.wraps, decorator factories, class-based decorators, and built-ins.

View cheat sheet →
Real Python itertools Cheat Sheet pages stacked on top of each other

Python itertools Cheat Sheet

Infinite iterators, islice and chain, batched and pairwise, combinatorics, accumulate, filtering, and groupby.

View cheat sheet →
Real Python Regex Cheat Sheet pages stacked on top of each other

Python Regex Cheat Sheet

Character classes, anchors, quantifiers, groups, lookarounds, flags, and the re module functions.

View cheat sheet →
Real Python File and Folder Automation Cheat Sheet pages stacked on top of each other

Python File and Folder Automation Cheat Sheet

pathlib, globbing, reading and writing files, shutil, file metadata, zip archives, and bulk rename recipes.

View cheat sheet →
Real Python Time and Space Complexity Cheat Sheet pages stacked on top of each other

Python Time and Space Complexity Cheat Sheet

Big O basics and the costs of lists, strings, dicts, sets, deques, heaps, sorting, binary search, recursion, and caching.

View cheat sheet →
Real Python Python Security Checklist pages stacked on top of each other

Python Security Checklist

Secrets, password hashing, encryption, HTTPS, input validation, injection, and dependency audits.

View cheat sheet →
Real Python Python Supply Chain Security Cheat Sheet pages stacked on top of each other

Python Supply Chain Security Cheat Sheet

Incident checks, startup hook scans, incident response, dependency cooldowns, lock files, audits, agent guardrails, and Trusted Publishing.

View cheat sheet →
Real Python Git Cheat Sheet pages stacked on top of each other

Git Cheat Sheet for Python Developers

Setup, staging and commits, .gitignore, diffs and logs, branches and merge conflicts, remotes, stash, and undoing mistakes.

View cheat sheet →

AI Apps, Agents, and Tools

Real Python LLM APIs and MCP Cheat Sheet pages stacked on top of each other

LLM APIs and MCP in Python Cheat Sheet

API calls in Python, messages and roles, structured outputs, tool calling, agent loops, and MCP servers and clients.

View cheat sheet →
Real Python Claude Code Cheat Sheet pages stacked on top of each other

Claude Code Cheat Sheet for Python Developers

Install, slash commands, CLI flags, keyboard shortcuts, CLAUDE.md, permissions, settings, hooks, skills, subagents, and MCP.

View cheat sheet →
Real Python Claude Code Hooks Cheat Sheet page

Claude Code Hooks Cheat Sheet for Python Developers

settings.json layout, lifecycle events, matchers, the exit-code contract, and Python hook scripts.

View cheat sheet →

Data Science and Machine Learning

Real Python pandas Cheat Sheet pages stacked on top of each other

pandas Cheat Sheet

read_csv, inspecting DataFrames, loc and iloc, filtering, missing data, groupby, pivot tables, and plotting.

View cheat sheet →
Pages of the Real Python Polars cheat sheet stacked on top of each other

Polars Cheat Sheet

Expressions, loading, selecting, filtering, cleaning, group by, LazyFrames, and plotting.

View cheat sheet →
Real Python conda Cheat Sheet pages stacked on top of each other

conda Cheat Sheet

Installing Miniconda, environments, packages, channels, environment.yml files, and pip inside conda.

View cheat sheet →
Real Python scikit-learn Workflow Cheat Sheet pages stacked on top of each other

scikit-learn Workflow Cheat Sheet

Train-test splits, preprocessing, pipelines, fitting, metrics, cross-validation, and GridSearchCV.

View cheat sheet →

Web Development

Real Python FastAPI Cheat Sheet pages stacked on top of each other

FastAPI Cheat Sheet

Routes, path and query parameters, Pydantic request bodies, responses, errors, dependencies, docs, and testing.

View cheat sheet →