Python Cheatsheets, One Diagram Per Command

Every command sits next to a picture of what it does.

python
cheatsheet
reference
Author

James Balamuta

Published

May 17, 2026

You remember the command exists. You remember roughly what it is for. What you cannot remember is whether it writes the lockfile or reads it, and the documentation page that would settle the question is four clicks away.

Ordinary cheatsheets do not help much here, because they answer the question you did not have. They tell you the spelling of a command you could have guessed, and stay silent on the thing you actually wanted, which is what the command does to your project when you run it.

This series takes the other approach. Every entry is a visual cheatsheet for one Python tool, and every command in it sits beside a small drawing of its effect. A file appearing. An environment filling up. A dataframe changing shape. You read the picture, and the command becomes the caption.

Browse all the Python cheatsheets

How Each One Reads

Every sheet is built from the same three-column row, so once you have read one you can read all of them.

Purpose says why you would reach for this. Command gives the exact invocation. Result draws what changed. Rows group into panels, one panel per area of the tool, and the panels stack into a single composite image covering the whole thing. Skim one panel when you roughly know where you are going, or keep the composite open on a second monitor when you do not.

Downloads

Each post carries the full composite as a single SVG, the individual panel diagrams alongside copy-pasteable code and a link into that tool’s official documentation, and a paginated PDF for printing. Everything comes in light and dark variants that follow your theme.

What Is Covered

Thirty-nine sheets are published, spanning most of what a working Python project touches.

Environments and packaging. uv, pip, and conda and mamba.

Dataframes and tables. pandas, polars, narwhals, PyArrow, DuckDB, and GeoPandas.

Arrays and numerics. NumPy, SciPy, and JAX.

Plotting. Matplotlib, seaborn, plotnine, and Plotly.

Modelling and machine learning. scikit-learn, statsmodels, PyTorch, PyTorch Lightning, Keras, XGBoost, and Optuna.

Text, models, and LLM work. Transformers, sentence-transformers, spaCy, the Anthropic Claude SDK, and instructor.

Web, APIs, and apps. FastAPI, httpx, Requests, Beautiful Soup, SQLAlchemy, and Streamlit.

Everyday tooling. pytest, Typer, Rich, pathlib, and Pydantic.

What Is Next

Four more are written and queued, arriving over the following days.

  • Gradio, building demo interfaces around a function.
  • Altair, declarative charts on the Vega-Lite grammar.
  • Ruff, linting and formatting in one fast tool.
  • Python Standard Library Power Tools, the parts of the standard library worth reaching for before installing anything.

The index is the live view of the series and is filterable by topic, so it stays current as sheets land.

See Also

The same treatment, applied to Quarto authoring: Quarto Cheatsheets.