Skip to main content

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_path across 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

# Project given + explicit dirs - detector runs, explicit dirs are added to its result
odoo-addons-path /path/to/project --addons-dir "./addons/*/18.0, ./custom"
odoo-addons-path /path/to/project --odoo-dir /opt/odoo

# No project given - detector SKIPPED (uses explicit paths only)
odoo-addons-path --odoo-dir /opt/odoo --addons-dir "./custom"

# Use environment variable with auto-detection
export CODEBASE=/home/project
odoo-addons-path

Detection Behavior: Layout detection runs only on a project path given explicitly, as an argument or through the CODEBASE environment variable. The current directory is never detected implicitly. Without a project path, the output is built only from --addons-dir/--odoo-dir. With neither a project path nor any explicit dir, the command prints an error and exits with status 1.

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

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.

Metadata

Release files for odoo-addons-path 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for odoo-addons-path 2.0.1
File Size Uploaded Provenance Actions
odoo_addons_path-2.0.1.tar.gz 510.7 kB With provenance Details for odoo_addons_path-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addons-path 2.0.1
File Interpreter ABI Platform Actions
odoo_addons_path-2.0.1-py3-none-any.whl Python 3 none any Details for odoo_addons_path-2.0.1-py3-none-any.whl

Total release size: 533.1 kB

Release files / odoo_addons_path-2.0.1.tar.gz

Download URL odoo_addons_path-2.0.1.tar.gz
Size 510.7 kB
Tags Source
SHA-256 checksum
How to use checksums
589d397d7740474f453f6cd54d6b998f97a0db763f0ea135987ec3d2bdb2b730
BLAKE2b-256 checksum
How to use checksums
e206dd38a81fd2dbad576dba58c44de9e687f471a03f348ca285a765b37789f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / odoo_addons_path-2.0.1-py3-none-any.whl

Download URL odoo_addons_path-2.0.1-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba880d4d67ba46d613664f5ce2ef1427637e80157d6f6287f712ee805e1a718a
BLAKE2b-256 checksum
How to use checksums
09843a4de4c65ea302af22cb99ddfbcdfcb899fc19978662c1bec8bb9d748b4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Security for odoo-addons-path 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for odoo_addons_path-2.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page