Python Libraries

Reference notes on the Python libraries and tooling used across this collection: the numerical stack, dataframes, plotting, environments, and the language features worth knowing properly.
Author

Benedict Thekkel

This is the lookup site. When a notebook elsewhere in the collection reaches for polars or pyecharts or asyncio, the page explaining it is here.

The notes are deliberately uneven in depth. A few pages are exhaustive because the library repays it, with NumPy, Pandas, and the Python class model each running to hundreds of cells. Others are a page of the commands actually used. Depth tracks how often the thing is reached for, not how important it sounds.


Numerical Core

Page Covers
NumPy The largest page on the site, working through arrays, indexing, broadcasting, and the operations built on them
SciPy The scientific layer above NumPy
NumExpr Faster evaluation of numerical expressions through multithreading, for when arrays get large enough to matter

Dataframes

Page Covers
Pandas The long reference
Polars The Rust-backed alternative
Dask Parallel computing that scales from one machine to a cluster, for datasets larger than memory, integrating with NumPy, pandas, and scikit-learn

Plotting and Diagrams

Page Covers
Matplotlib The default, and what everything else is measured against
ECharts The most detailed of these, on pyecharts. ECharts describes a chart as one JSON-like option object covering data, axes, series, styling, and interaction. This is the charting library the deep learning notebooks are required to use
Plotly Interactive publication-quality charts inside Jupyter
Bokeh Another interactive browser-rendered option
Altair Declarative interactive plots
Graphviz Graph and diagram layout from a text description
Mermaid Diagrams as markdown, which is what the diagram pages in Software Tools are built from
Manim Programmatic mathematical animation

The Language Itself

Page Covers
Python Classes The object model at length: definition, inheritance, the dunder methods, and the protocols they implement
asyncio A complete reference targeting Python 3.11 and up, which is the meaningful floor because TaskGroup, asyncio.timeout(), and task.uncancel() all landed there and they change what correct code looks like
Multiprocessing The other concurrency route, for when the work is CPU-bound
Logging The standard library logging module
argparse Command line arguments
Dataclasses The decorator that writes __init__, __repr__, and __eq__ for you
Datetime Dates, times, timezones, and formatting
AST Parsing, inspecting, and transforming Python source as a tree

Environments and Packaging

Six tools that solve overlapping versions of the same problem, in roughly the order they appeared.

Page Covers
venv The one in the standard library
Pipenv Dependency resolution with a lockfile
Poetry Dependency management plus packaging
Conda The scientific-stack option, which handles non-Python dependencies
uv The Rust-based one this collection actually uses
direnv Loading and unloading an environment automatically on directory change
Environment Variables How they work in Linux and how to manage them

Code Quality and Testing

Page Covers
Ruff The fast Python-native linter that replaces flake8 and pylint, and overlaps Black
Ruff Rule Categories What each rule family prefix means, F, E, W, N, B, and the rest, and why you would enable it
Black The uncompromising formatter that ends style arguments by making the decisions for you
pytest Basics through fixtures, plugins, and practice
Monkey Patching What it is, when it is justified, the risks, and how it shows up in pytest

Notebooks and Terminal Output

Page Covers
nbdev The framework this entire collection is built on, turning notebooks into libraries and docs
Marimo The reactive notebook alternative, and how it differs from JupyterLab
ipywidgets Interactive controls inside a notebook
Rich Terminal output worth looking at: tables, progress, syntax highlighting
tqdm A progress bar around any loop

Data In

Page Covers
Requests and HTTPX The standard HTTP client against the one that adds async and HTTP/2
BeautifulSoup4 Parsing HTML and XML, mostly for scraping
duckduckgo-search Programmatic search across words, documents, images, news, and maps
Kaggle Pulling competition and dataset files
SQLAlchemy The 2.x-style guide to Python’s ORM and query builder
pytube Downloading video

Odds and Ends

Page Covers
Latexify Rendering a Python function as the LaTeX equation it implements
Mito A spreadsheet interface over a dataframe
pivottablesjs Interactive pivot tables in a notebook

Not Covered Yet

  • The site title says MLtools but the content is general Python. Very little here is machine learning specific; the modelling libraries live in ML Methods and DL Methods.
  • No page on typing, despite type hints being unavoidable in modern Python.
  • Nothing on pydantic, which is the validation layer most projects reach for.
  • pathlib and file handling have no page, only incidental use elsewhere.
  • Six environment tools, no recommendation. The pages describe each without saying which to pick, though the collection itself uses uv.
  • uv is five cells against a tool the whole repo depends on, so it is the thinnest page relative to its importance.

Back to top