Yes, you can structure multiple Python projects (like magicbricks-etl) under an umbrella project (like magicbricks) using Poetry, but it's important to understand how Poetry works and what it does not support directly.
✅ Goal
You want a structure like:
magicbricks/
├── README.md
├── magicbricks-etl/
│ ├── pyproject.toml
│ └── ...
├── magicbricks-analytics/
│ ├── pyproject.toml
│ └── ...
└── other-utils/
└── ...
Each sub-project (like magicbricks-etl) is managed independently by Poetry.
✅ How to Achieve This
Although Poetry doesn't support monorepos or workspaces natively (as of now), you can still:
🧩 Option 1: Treat Each Subproject Separately
Each directory (like magicbricks-etl) is its own isolated Poetry project:
mkdir -p magicbricks/magicbricks-etl
cd magicbricks/magicbricks-etl
poetry init # or poetry new magicbricks_etl
This creates a standalone Poetry project inside the umbrella.
You repeat the same for other parts:
mkdir -p magicbricks/magicbricks-analytics
cd magicbricks/magicbricks-analytics
poetry init
✅ This gives you modular independent components.
👉 Referencing One Sub-Project from Another
To use magicbricks-etl in magicbricks-analytics, there are two common solutions:
💡 Use a Path Dependency
If you want to install one sub-project from another (e.g., magicbricks-analytics uses magicbricks-etl):
In magicbricks-analytics/pyproject.toml:
[tool.poetry.dependencies]
magicbricks-etl = { path = "../magicbricks-etl" }
Then run:
poetry install
This links the dependency from the local directory instead of pulling from PyPI.
🧪 Pro Tips
- Use a top-level README.md and even a script or Makefile in the umbrella dir to orchestrate development tasks across all sub-packages, e.g. testing, linting.
- Use virtual environments inside each project (Poetry handles this automatically).
- You can use
tox or if you need better support for orchestrating a monorepo.