Metadata-Version: 2.4
Name: o2a.registry.python.lib
Version: 0.3.1
Summary: Basic wrapper around the https://registry.o2a-data.de/api/ powered by pydantic.
Project-URL: Homepage, https://registry.o2a-data.de/
Project-URL: Documentation, https://o2a-data.de/docs/o2a-registry-py/getting_started.html
Project-URL: Repository, https://gitlab.awi.de/o2a/registry/o2a.registry.python.lib.git
Project-URL: Issues, https://gitlab.awi.de/o2a/registry/o2a.registry.python.lib/-/issues
Author-email: Karsten Schimpf <karsten.schimpf@awi.de>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: O2A,api,registry
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: aiohttp>=3.10.8
Requires-Dist: email-validator>=2.2.0
Requires-Dist: pydantic>=2.9.2
Description-Content-Type: text/markdown

# O2A Registry API Wrapper

[![pipeline status](https://gitlab.awi.de/data-logistics-support/o2a-registry-py/badges/main/pipeline.svg)](https://gitlab.awi.de/data-logistics-support/o2a-registry-py/-/commits/main)
[![coverage report](https://gitlab.awi.de/data-logistics-support/o2a-registry-py/badges/main/coverage.svg)](https://gitlab.awi.de/data-logistics-support/o2a-registry-py/-/commits/main)
[![Latest Release](https://gitlab.awi.de/data-logistics-support/o2a-registry-py/-/badges/release.svg)](https://gitlab.awi.de/data-logistics-support/o2a-registry-py/-/releases)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Documentation](https://img.shields.io/badge/Documentation-o2a--data.de-blue)](https://o2a-data.de/docs/o2a-registry-py/getting_started.html)

Basic wrapper around the [registry API](https://registry.o2a-data.de/api/)
powered by [pydantic](https://docs.pydantic.dev/latest/).

Note: Currently, rate limited to 100 requests/sec

## Example Usage

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

event_types = await ProductionAPI.get_vocables(where="vocableGroup.id==8")

await ProductionAPI.close()
```

Custom endpoint:

```python
from o2a_registry.api import RegistryApi

api = RegistryApi("example.com", ssl=True)
```

Further examples can be found in
[examples](https://gitlab.awi.de/data-logistics-support/o2a-registry-py/-/tree/main/examples?ref_type=heads)

## Install

Currently, only available from the gitlab repository:

```shell
pip install o2a.registry.python.lib
```

## Setting up the project locally

This project uses the package manager [uv](https://docs.astral.sh/uv/)

```shell
git clone git@gitlab.awi.de:o2a/registry/o2a.registry.python.lib.git
cd o2a.registry.python.lib

uv sync
```

This creates a virtual environment in `o2a.registry.python.lib/.venv/`.

The code formatter [Ruff](https://docs.astral.sh/ruff/) is used to ensure proper
code formatting. Use `uv tool install ruff` to install and `uvx ruff format .`
to run.

Before pushing changes, please ensure that your code works and is well formated.
You can do this with:

```shell
uvx ruff check --fix
uvx ruff format

uv run mypy o2a_registry
uv run pytest ./tests/unit
```

### Generate documentation

Install the necessary dependencies with

```
uv sync --group doc
```

Build documentation with

```
uv run sphinx-build -M html docs/source/ docs/build/
```

Open `docs/build/html/index.html` to see the result.
