Skip to main content

Collect data from Odoo module folders.

Project description

odoo-addons-parser

Version Supported Versions Pre-commit Status Tests Status

Python package to collect and analyze data from Odoo module folders without requiring an Odoo runtime. It performs static file analysis to extract useful information from Odoo modules.

Features

  • Static Analysis: Doesn't rely on any Odoo runtime; performs static files analysis
  • Code Statistics: Count lines of code (Python, XML, JavaScript, and CSS)
  • Manifest Parsing: Extract useful data from manifest files (authors, dependencies, etc.)
  • Model Extraction: Extract Odoo models information (with fields and methods)
  • Data Extraction: Extract data from XML and CSV files
  • Flexible Scanning: Scan individual modules, repositories, or entire Odoo source code

Installation

uv pip install odoo-addons-parser

Or with pip:

pip install odoo-addons-parser

Usage

ModuleParser

Parse a single Odoo module:

from odoo_addons_parser import ModuleParser
from pprint import pprint as pp

mod = ModuleParser("/path/to/OCA/server-tools/server_environment")
pp(mod.to_dict())

Example output:

{
    'code': {'CSS': 0, 'JavaScript': 0, 'Python': 541, 'XML': 21},
    'manifest': {
        'author': 'Camptocamp,Odoo Community Association (OCA)',
        'category': 'Tools',
        'data': ['security/ir.model.access.csv', 'security/res_groups.xml', 'serv_config.xml'],
        'depends': ['base', 'base_sparse_field'],
        'installable': True,
        'license': 'GPL-3 or any later version',
        'name': 'server configuration environment files',
        'summary': 'move some configurations out of the database',
        'version': '14.0.1.0.0',
        'website': 'https://github.com/OCA/server-env'
    },
    'models': ...,
    'name': 'server_environment'
}

RepositoryParser

Parse a whole repository of addons:

from odoo_addons_parser import RepositoryParser

repo = RepositoryParser("/path/to/OCA/server-tools")
pp(repo.to_dict())

OdooParser

Parse the Odoo source code repository:

from odoo_addons_parser import OdooParser

odoo = OdooParser("/path/to/odoo/odoo")
data = odoo.to_dict()
list(data["__odoo__"]["models"])
# ["BaseModel", "Model", "TransientModel"]
"res.partner" in data["base"]["models"]
# True

Parameters

You can disable specific features using parameters:

# Disable code statistics
repo = RepositoryParser("path/to/addons_path", code_stats=False)

# Disable model scanning
mod = ModuleParser("path/to/addons_path/module", scan_models=False)

# Disable data scanning
mod = ModuleParser("path/to/addons_path/module", scan_data=False)

# Disable all
odoo = OdooParser("/path/to/odoo/odoo", code_stats=False, scan_models=False, scan_data=False)

License

This project is licensed under the LGPL-3.0 License - see the LICENSE file for details.

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

odoo_addons_parser-0.7.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odoo_addons_parser-0.7-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file odoo_addons_parser-0.7.tar.gz.

File metadata

  • Download URL: odoo_addons_parser-0.7.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for odoo_addons_parser-0.7.tar.gz
Algorithm Hash digest
SHA256 dd4b6438388d86cef29d58479a5b8c107ab5476f16f81abd06fa923fec585cca
MD5 e6a8a3f81cadb6249f9dc60acb7039ef
BLAKE2b-256 0bca8fed0e79109cca8486d06cc3bef649034b0ef2109326acf867a164f6bda5

See more details on using hashes here.

Provenance

The following attestation bundles were made for odoo_addons_parser-0.7.tar.gz:

Publisher: publish.yml on sebalix/odoo-addons-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file odoo_addons_parser-0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addons_parser-0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0465d0f8052dbc1f308de42df533713743d2717f41afa0175b1c72b399eaeb2c
MD5 8559c880abf0db8818e5b83a5785b46f
BLAKE2b-256 a855c0999fbd5186df94e73e6ae703ad43ebdcafdf5b9866f623c3f5b79b4b18

See more details on using hashes here.

Provenance

The following attestation bundles were made for odoo_addons_parser-0.7-py3-none-any.whl:

Publisher: publish.yml on sebalix/odoo-addons-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page