skip to content

Essential Python Packages

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.

3 min read yesterday quick read

Essential Python Packages#

Each entry below links to a dedicated page with purpose, install command, code examples, outputs, and common pitfalls.

HTTP & Networking#

PackageInstallPurpose
requestspip install requestsSync HTTP client β€” the classic choice
httpxpip install httpxModern sync + async HTTP client

Data Science & Numerics#

PackageInstallPurpose
numpypip install numpyN-dimensional arrays and vectorized math
pandaspip install pandasDataFrames for tabular data
matplotlibpip install matplotlib2-D plotting and figure generation
scipypip install scipyScientific algorithms (stats, optimize, signal)
pillowpip install pillowImage reading, transformation, and saving

Async & Concurrency#

PackageInstallPurpose
asyncio(stdlib β€” no install)Built-in async/await event loop

Standard Library Highlights#

PackageInstallPurpose
pathlib(stdlib β€” no install)Object-oriented filesystem path handling

CLI & Interfaces#

PackageInstallPurpose
clickpip install clickDecorator-based CLI builder
richpip install richTerminal formatting, tables, progress bars

Data Validation & Modeling#

PackageInstallPurpose
pydanticpip install pydanticRuntime type validation with Python type hints

Databases#

PackageInstallPurpose
sqlalchemypip install sqlalchemyORM + SQL toolkit for Python

Web Frameworks#

PackageInstallPurpose
flaskpip install flaskLightweight WSGI micro-framework
djangopip install djangoFull-featured batteries-included framework
fastapipip install fastapiFast ASGI API framework with auto-docs

Logging#

PackageInstallPurpose
logurupip install loguruStructured logging with zero configuration

Notebooks & Interactive#

PackageInstallPurpose
jupyterpip install jupyterlabInteractive notebooks for data exploration

Testing#

PackageInstallPurpose
pytestpip install pytestTest discovery, fixtures, and parametrize

Type Checking#

PackageInstallPurpose
mypypip install mypyStatic type checker

Code Quality & Formatting#

PackageInstallPurpose
ruffpip install ruffFast all-in-one linter and formatter (replaces black + flake8 + isort)
blackpip install blackOpinionated code formatter

Packaging & Dependency Management#

PackageInstallPurpose
uvcurl -LsSf https://astral.sh/uv/install.sh | shBlazing-fast installer and project manager
poetrypip install poetrypyproject.toml-based dependency management and publishing

Quick decision guide#

  • New project, greenfield? β†’ Use uv for environment + deps, ruff for linting, pytest for tests, pydantic for validation.
  • Building a REST API? β†’ fastapi + pydantic + sqlalchemy.
  • Quick internal tool? β†’ flask (small) or django (if you need admin/auth out of the box).
  • Data analysis script? β†’ pandas + matplotlib; add scipy for statistics.
  • HTTP calls? β†’ requests for sync, httpx for async or when you want HTTP/2.
  • Logging? β†’ loguru for new projects; it replaces logging with zero boilerplate.
  • Data exploration? β†’ jupyter + pandas + matplotlib β€” run cells interactively.
  • Async concurrency? β†’ asyncio (stdlib) + httpx for async HTTP or fastapi for async APIs.
  • File paths? β†’ pathlib (stdlib) β€” never use os.path.join() again.