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.

Release files for odoo-addons-path 2.0.0

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.0
File Size Uploaded
odoo_addons_path-2.0.0.tar.gz 510.5 kB Details

Built distribution (wheel)

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

Total release size: 532.9 kB

Release files / odoo_addons_path-2.0.0.tar.gz

Download URL odoo_addons_path-2.0.0.tar.gz
Size 510.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b379116c35f879439e7c6821d45d0c37fe77aa1c8af4978496c83078997286b3
BLAKE2b-256 checksum
How to use checksums
b313f5b03ffa92348bfe42318b18e78e45952f192d63c0b9e99a8e7b1361ad67
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 25, 2026.

Transparency log

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

Download URL odoo_addons_path-2.0.0-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3975fce604d160b88a580b005546343e825d58a4960154722e46c0fb26c5eda3
BLAKE2b-256 checksum
How to use checksums
6b8cd66bb82cc050afe1e2dd5c28b1e12e7ec28234b38c602b4e5eb30117ee60
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 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

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