To share code — with teammates, a server, or the world (PyPI) — you package it. A packaged project has a standard layout and a pyproject.toml that declares its metadata and dependencies, so anyone can install it reproducibly with pip.
pyproject.toml
This single file is the modern standard for project configuration — metadata, dependencies, and the build system:
[project]name = "albero-tools"version = "0.1.0"requires-python = ">=3.10"dependencies = ["requests>=2.31", "pandas"][project.scripts]albero = "albero_tools.cli:main" # a command-line entry point[build-system]requires = ["hatchling"]build-backend = "hatchling.build"
Project layout & building
albero-tools/├── pyproject.toml├── src/albero_tools/│ ├── __init__.py│ └── cli.py└── tests/# build a distributable, then install itpython -m buildpip install .
Key takeaways
- 01pyproject.toml is the modern file for project metadata, dependencies and build config.
- 02Declare dependencies with sensible version ranges; add entry points under [project.scripts].
- 03The src/ layout keeps imports clean and catches packaging errors.
- 04python -m build produces installable artifacts; pip install . installs locally.
