Python tooling support for the Polylith Architecture
Actively maintained. Last release 8 days ago, commits in 8 of the last 26 weeks. A safe choice.
pip install polylith-cliPython tooling for Polylith
A command line interface that adds tooling support for the Polylith Architecture in Python.
Documentation
Have a look at the documentation. You will find installation, setup, usage guides and more.
Quick start
Poetry user? For Poetry, the recommended setup is to install the poetry-polylith-plugin.
Read more about Poetry in the documentation.
Setup for Hatch users
Create a directory for your code, initialize it with git and setup the basics with hatch:
git init
hatch new --init
Add the Polylith CLI as a dev dependency in pyproject.toml:
[tool.hatch.envs.default]
dependencies = ["polylith-cli"]
Add configuration for a local virtual environment in the pyproject.toml:
[tool.hatch.envs.default]
type = "virtual"
path = ".venv"
python = "3.12" # your preferred version here
Make Hatch aware of the Polylith structure, by adding this to the pyproject.toml:
[tool.hatch.build]
dev-mode-dirs = ["components", "bases", "development", "."]
Next: create a Polylith workspace, with a basic Polylith folder structure.
The poly command is now available in the local virtual environment.
You can run commands in the context of hatch run to make Polylith aware of the development environment.
hatch run poly create workspace --name my_namespace --theme loose
Ready for coding!
Add components, bases and projects:
hatch run poly create component --name my_component
hatch run poly create base --name my_example_endpoint
hatch run poly create project --name my_example_project
For details, have a look at the documentation. There, you will find guides for setup, migration, packaging, available commands, code examples and more.
Setup for PDM users
Create a directory for your code, initialize it with git and setup the basics with .