Skip to main content

Odoo API Client Python

Cliente de API para realizar la integración con los servicios web de Odoo desde Python.

pip install git+ssh://git@github.com/sascocl/odoo-api-client-python.git#egg=odoo_api_client

Autenticación en Odoo

Lo más simple, y recomendado, es usar variables de entorno con las credenciales de autenticación de la API de Odoo. Las cuales serán reconocidas automáticamente por el cliente de la API.

export ODOO_API_HOST="api-host-odoo"
export ODOO_API_DATABASE="api-name-database-odoo"
export ODOO_API_USER="api-user-odoo"
export ODOO_API_PASSWORD="api-password-odoo"

Si no se desea usar variables de entorno, al instanciar los objetos se deberán indicar las credenciales de autenticación. Ejemplo con el cliente genérico:

from odoo_api_client import ApiClient
ODOO_API_HOST="api-host-odoo"
ODOO_API_DATABASE="api-name-database-odoo"
ODOO_API_USER="api-user-odoo"
ODOO_API_PASSWORD="api-password-odoo"
client = ApiClient(ODOO_API_HOST, ODOO_API_DATABASE, ODOO_API_USER, ODOO_API_PASSWORD)

El siguiente es un ejemplo con el cliente específico de HelpdeskTicket.

from odoo_api_client.models.helpdesk.helpdesk_ticket import HelpdeskTicket
ODOO_API_HOST="api-host-odoo"
ODOO_API_DATABASE="api-name-database-odoo"
ODOO_API_USER="api-user-odoo"
ODOO_API_PASSWORD="api-password-odoo"
helpdesk_ticket_client = HelpdeskTicket(ODOO_API_HOST, ODOO_API_DATABASE, ODOO_API_USER, ODOO_API_PASSWORD)

Desarrollo

Requiere Python 3.14. La configuración del proyecto, sus dependencias y las herramientas de desarrollo están en pyproject.toml. El entorno virtual venv se crea con:

make PYTHON=python3.14 install-dev

Si ya existe un venv con otra versión de Python, se debe eliminar antes (rm -rf venv), ya que el Makefile no recrea un entorno existente.

Verificaciones (las mismas que ejecuta el CI):

make check      # lint + typecheck + tests
make lint       # ruff check
make typecheck  # mypy y pyright en modo estricto
make tests      # pruebas unitarias con cobertura mínima de 95%

Las pruebas unitarias (tests/unit) usan un Odoo simulado, sin conexión.

Las pruebas de integración (tests/integration) se ejecutan contra un Odoo real y crean y modifican datos en él. Usan las variables de tests/test.env (copiar desde tests/test.env-dist) y no se ejecutan con make tests:

make tests-integration

Para generar el paquete en dist/ y publicarlo en PyPI (público), con las credenciales de ~/.pypirc o de TWINE_USERNAME/TWINE_PASSWORD:

make build
make upload

Para generar la documentación con Sphinx:

make docs

Metadata

Release files for odoo-api-client 4.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-api-client 4.0.0
File Size Uploaded Provenance Actions
odoo_api_client-4.0.0.tar.gz 27.0 kB Without provenance Details for odoo_api_client-4.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for odoo-api-client 4.0.0
File Interpreter ABI Platform Actions
odoo_api_client-4.0.0-py3-none-any.whl Python 3 none any Details for odoo_api_client-4.0.0-py3-none-any.whl

Total release size: 67.6 kB

Release files / odoo_api_client-4.0.0.tar.gz

Download URL odoo_api_client-4.0.0.tar.gz
Size 27.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7572cd9a81f36ae6bca0f6d472b3a1ccd2541c4cbbb100ffe003b9cd561c0524
BLAKE2b-256 checksum
How to use checksums
ca34afaf37acc0a65400becbea08a54f3d165ac11b2e9b979caf4625d49fb91a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / odoo_api_client-4.0.0-py3-none-any.whl

Download URL odoo_api_client-4.0.0-py3-none-any.whl
Size 40.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a51e0e4c604dc649edd2ce0b98587453d6816b43ff9870319684569626e2224
BLAKE2b-256 checksum
How to use checksums
a4f37159df43b3e4003a4fc0b20f26e8fc2afd5934229fc2637dab275ba3b80f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for odoo-api-client 4.0.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files No provenance

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