Essential Python Packages#
Each entry below links to a dedicated page with purpose, install command, code examples, outputs, and common pitfalls.
HTTP & Networking#
| Package | Install | Purpose |
|---|
| requests | pip install requests | Sync HTTP client β the classic choice |
| httpx | pip install httpx | Modern sync + async HTTP client |
Data Science & Numerics#
| Package | Install | Purpose |
|---|
| numpy | pip install numpy | N-dimensional arrays and vectorized math |
| pandas | pip install pandas | DataFrames for tabular data |
| matplotlib | pip install matplotlib | 2-D plotting and figure generation |
| scipy | pip install scipy | Scientific algorithms (stats, optimize, signal) |
| pillow | pip install pillow | Image reading, transformation, and saving |
Async & Concurrency#
| Package | Install | Purpose |
|---|
| asyncio | (stdlib β no install) | Built-in async/await event loop |
Standard Library Highlights#
| Package | Install | Purpose |
|---|
| pathlib | (stdlib β no install) | Object-oriented filesystem path handling |
CLI & Interfaces#
| Package | Install | Purpose |
|---|
| click | pip install click | Decorator-based CLI builder |
| rich | pip install rich | Terminal formatting, tables, progress bars |
Data Validation & Modeling#
| Package | Install | Purpose |
|---|
| pydantic | pip install pydantic | Runtime type validation with Python type hints |
Databases#
| Package | Install | Purpose |
|---|
| sqlalchemy | pip install sqlalchemy | ORM + SQL toolkit for Python |
Web Frameworks#
| Package | Install | Purpose |
|---|
| flask | pip install flask | Lightweight WSGI micro-framework |
| django | pip install django | Full-featured batteries-included framework |
| fastapi | pip install fastapi | Fast ASGI API framework with auto-docs |
Logging#
| Package | Install | Purpose |
|---|
| loguru | pip install loguru | Structured logging with zero configuration |
Notebooks & Interactive#
| Package | Install | Purpose |
|---|
| jupyter | pip install jupyterlab | Interactive notebooks for data exploration |
Testing#
| Package | Install | Purpose |
|---|
| pytest | pip install pytest | Test discovery, fixtures, and parametrize |
Type Checking#
| Package | Install | Purpose |
|---|
| mypy | pip install mypy | Static type checker |
| Package | Install | Purpose |
|---|
| ruff | pip install ruff | Fast all-in-one linter and formatter (replaces black + flake8 + isort) |
| black | pip install black | Opinionated code formatter |
Packaging & Dependency Management#
| Package | Install | Purpose |
|---|
| uv | curl -LsSf https://astral.sh/uv/install.sh | sh | Blazing-fast installer and project manager |
| poetry | pip install poetry | pyproject.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.