Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time

Python tools for the Polylith Architecture

A repo containing tooling support for the Polylith Architecture in Python.


CodeScene general

What's Polylith? 🤔

Polylith is an architecture (with tooling support) originally built for Clojure. The code in this repo brings Polylith to Python.

From the official Polylith Architecture docs:

... Polylith is a software architecture that applies functional thinking at the system scale. It helps us build simple, maintainable, testable, and scalable backend systems. ...

Polylith is using a components-first architecture. Similar to LEGO, components are building blocks. A component can be shared across apps, serverless functions and microservices.

Documentation 📚

Have a look at the Python-specific documentation. You will find installation, setup, usage guides and more.

Polylith for Python? 🐍

This repo contains a Poetry plugin, that you can install from PyPI. The plugin will add Polylith specific tooling support to Poetry. Have a look in the Poetry Polylith Plugin project folder with details about the Poetry plugin.

Use cases

Microservices and apps 👍

The main use case is to support having one or more microservices (or apps) in a Monorepo, and share code between the services.


Polylith for Python isn't mainly for building libraries published to PyPI, even if it is supported. Consider that the code in one library will share the same top namespace with other libraries that are built from the same Polylith Monorepo. This will likely be a problem when more than one of your libraries would be installed into the same virtual environment.

There is solution avaiable for this. 😃


Have a look at the Python Polylith Examples repository. It is a repository with an example Python setup of the Polylith Architecture. You will find examples of sharing code between different kind of projects, and developer tooling setup such as mypy and the venv.