Create the ultimate Odoo addons_path constructor
Project description
odoo-addons-path
Automatically detect and construct Odoo addons_path for various project layouts.
Problem
Different Odoo project frameworks use different directory structures:
- Trobz, Camptocamp, Odoo.sh, Doodba each have unique layouts
- Manual configuration is error-prone and time-consuming
- Developers need consistent
addons_pathacross team projects
Solution
odoo-addons-path auto-detects your project layout and generates the correct configuration:
$ odoo-addons-path /home/project
/home/project/odoo/addons,/home/project/addons/repo1,/home/project/addons/repo2
Installation
pip install odoo-addons-path
Quick Start
CLI Usage
# Auto-detect layout (detector runs)
odoo-addons-path /path/to/your/odoo/project
# With verbose output (categorized paths)
odoo-addons-path /path/to/project --verbose
# Manual addon paths - detector SKIPPED (uses explicit path only)
odoo-addons-path /path/to/project --addons-dir "./addons/*/18.0, ./custom"
# Manual Odoo path - detector SKIPPED (uses explicit path only)
odoo-addons-path /path/to/project --odoo-dir /opt/odoo
# Both explicit - detector SKIPPED (uses both paths)
odoo-addons-path /path/to/project --odoo-dir /opt/odoo --addons-dir "./custom"
# Use environment variable with auto-detection
export CODEBASE=/home/project
odoo-addons-path
Detector Skip Behavior: Detector is skipped if ANY explicit path is provided (--addons-dir or --odoo-dir). This ensures predictable behavior with explicit configuration.
Programmatic Usage
from pathlib import Path
from odoo_addons_path import get_addons_path
# Auto-detect layout
paths = get_addons_path(Path("/path/to/project"))
print(paths)
# Output: /path/to/project/addons,/path/to/project/enterprise
# With options
paths = get_addons_path(
codebase=Path("/home/project"),
addons_dir=[Path("/home/project/custom")],
verbose=True
)
Supported Layouts
Auto-detects these Odoo project organizational patterns:
| Layout | Marker | Detection | Status |
|---|---|---|---|
| Trobz | .trobz/ directory |
Explicit marker | ✓ Supported |
| Camptocamp (C2C) | Dockerfile with label | File content | ✓ Supported |
| Odoo.sh | 4-dir structure | Directory check | ✓ Supported |
| Doodba | .copier-answers.yml |
YAML config | ✓ Supported |
| Generic | Any __manifest__.py |
Recursive search | ✓ Fallback |
See tests/data/ directory for layout examples.
Features
- Zero Configuration: Works out-of-the-box for standard layouts
- Multiple Interfaces: CLI tool and Python library
- Flexible Input: Glob patterns, comma-separated paths, environment variables
- Type Safe: Full Python type hints
- Well Tested: 5 real-world layout patterns covered
- Production Ready: Used in multiple Odoo teams
Documentation
- Project Overview & PDR - Vision, goals, and requirements
- System Architecture - Design patterns and data flow
- Code Standards - Development guidelines and conventions
- Codebase Summary - Module structure and components
- Deployment Guide - Release and deployment procedures
- Contributing - How to contribute to the project
Development
Setup
uv sync
uv run pre-commit install
Testing
# Single version
make test
# All supported versions (3.10-3.13)
tox
# Quality checks
make check
Release
Releases are automated via semantic versioning on merge to main:
git commit -m "feat: add new feature" # Creates MINOR version
git commit -m "fix: bug fix" # Creates PATCH version
git commit -m "feat!: breaking change" # Creates MAJOR version
Requirements
- Python 3.10+
- pyyaml
- typer >= 0.19.2
Status
v1.0.0 - Stable release (Nov 25, 2025)
See CHANGELOG.md for version history.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_addons_path-1.2.0.tar.gz.
File metadata
- Download URL: odoo_addons_path-1.2.0.tar.gz
- Upload date:
- Size: 70.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62d8f33a52b0b055cb5ca8880b0eb42c5db260af161c77f2fd7956754e0d4b3e
|
|
| MD5 |
b765e098b63ae78f988bf59d6286b191
|
|
| BLAKE2b-256 |
bb2dd2f39b81b20a4864a0153748d39bb7bb7959bfae386fc759fe3674061ae7
|
Provenance
The following attestation bundles were made for odoo_addons_path-1.2.0.tar.gz:
Publisher:
release.yaml on trobz/odoo-addons-path
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
odoo_addons_path-1.2.0.tar.gz -
Subject digest:
62d8f33a52b0b055cb5ca8880b0eb42c5db260af161c77f2fd7956754e0d4b3e - Sigstore transparency entry: 1169696869
- Sigstore integration time:
-
Permalink:
trobz/odoo-addons-path@759d91fab88982d3b0e0b3bbc9a9f0e60bd08d45 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/trobz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@759d91fab88982d3b0e0b3bbc9a9f0e60bd08d45 -
Trigger Event:
push
-
Statement type:
File details
Details for the file odoo_addons_path-1.2.0-py3-none-any.whl.
File metadata
- Download URL: odoo_addons_path-1.2.0-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc869ca58b7449a5594f00852bcb62f87b66f0fad3b889bf66eddf4485bd2f67
|
|
| MD5 |
4f97dfad8cd9f4ed3a0cd1a11f1192c4
|
|
| BLAKE2b-256 |
fc466977491ca3665f1379baf38c6b03424cb6d1dbb9122832e24f916a81d4a2
|
Provenance
The following attestation bundles were made for odoo_addons_path-1.2.0-py3-none-any.whl:
Publisher:
release.yaml on trobz/odoo-addons-path
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
odoo_addons_path-1.2.0-py3-none-any.whl -
Subject digest:
bc869ca58b7449a5594f00852bcb62f87b66f0fad3b889bf66eddf4485bd2f67 - Sigstore transparency entry: 1169697118
- Sigstore integration time:
-
Permalink:
trobz/odoo-addons-path@759d91fab88982d3b0e0b3bbc9a9f0e60bd08d45 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/trobz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@759d91fab88982d3b0e0b3bbc9a9f0e60bd08d45 -
Trigger Event:
push
-
Statement type: