Collect data from Odoo module folders.
Project description
odoo-addons-parser
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
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_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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd4b6438388d86cef29d58479a5b8c107ab5476f16f81abd06fa923fec585cca
|
|
| MD5 |
e6a8a3f81cadb6249f9dc60acb7039ef
|
|
| BLAKE2b-256 |
0bca8fed0e79109cca8486d06cc3bef649034b0ef2109326acf867a164f6bda5
|
Provenance
The following attestation bundles were made for odoo_addons_parser-0.7.tar.gz:
Publisher:
publish.yml on sebalix/odoo-addons-parser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
odoo_addons_parser-0.7.tar.gz -
Subject digest:
dd4b6438388d86cef29d58479a5b8c107ab5476f16f81abd06fa923fec585cca - Sigstore transparency entry: 1191199049
- Sigstore integration time:
-
Permalink:
sebalix/odoo-addons-parser@947fe4e9262f5eabadb227c07e6135912b855fb9 -
Branch / Tag:
refs/tags/v0.7 - Owner: https://github.com/sebalix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@947fe4e9262f5eabadb227c07e6135912b855fb9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file odoo_addons_parser-0.7-py3-none-any.whl.
File metadata
- Download URL: odoo_addons_parser-0.7-py3-none-any.whl
- Upload date:
- Size: 42.8 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 |
0465d0f8052dbc1f308de42df533713743d2717f41afa0175b1c72b399eaeb2c
|
|
| MD5 |
8559c880abf0db8818e5b83a5785b46f
|
|
| BLAKE2b-256 |
a855c0999fbd5186df94e73e6ae703ad43ebdcafdf5b9866f623c3f5b79b4b18
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
odoo_addons_parser-0.7-py3-none-any.whl -
Subject digest:
0465d0f8052dbc1f308de42df533713743d2717f41afa0175b1c72b399eaeb2c - Sigstore transparency entry: 1191199052
- Sigstore integration time:
-
Permalink:
sebalix/odoo-addons-parser@947fe4e9262f5eabadb227c07e6135912b855fb9 -
Branch / Tag:
refs/tags/v0.7 - Owner: https://github.com/sebalix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@947fe4e9262f5eabadb227c07e6135912b855fb9 -
Trigger Event:
push
-
Statement type: