Skip to content
O2A Documentation

O2A Registry API Wrapper for Python

The O2A Registry API Wrapper for Python is now available on PyPI. Therefore, it can be installed with

bash
pip install o2a.registry.python.lib

It simplifies the usage of the API by providing a well-documented and typed interface to O2A Registry's API routes and data model.

python
from o2a_registry.api import ProductionAPI  # registry.o2a-data.de
from o2a_registry.api import SandboxAPI     # registry.sandbox.o2a-data.de

from o2a_registry.models import Item

POLARSTERN_ITEM_ID = 90
polarstern: Item = await SandboxAPI.get_item(POLARSTERN_ITEM_ID)
print("Polarstern description:", polarstern.description)

await SandboxAPI.close()

It also comes with utility functions for interacting with paginated endpoints. See the documentation on how to use the library.

Currently, the wrapper does only cover the most used API endpoints (see the documentation for more information). If you need endpoints, that are currently not covered by the wrapper, feel free to open an issue or contribute to the source code.