Metadata-Version: 2.4
Name: emudb-api-py
Version: 0.5.2
Summary: Strictly typed python library facilitating access to the Axiell EMu Collections Management System through their REST API.
License: AGPL 3.0
License-File: LICENSE
Author: Chris Larabee
Author-email: chris.larabee9@gmail.com
Requires-Python: >=3.14
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Dist: pydantic (>=2.13.5,<3.0.0)
Requires-Dist: requests (>=2.34.2,<3.0.0)
Requires-Dist: requests-futures (>=1.1.0,<2.0.0)
Description-Content-Type: text/markdown

# emudb-api-py

The emudb-api-py library leverages [pydantic](https://pypi.org/project/pydantic/), [requests](https://pypi.org/project/requests/), and [requests-futures](https://pypi.org/project/requests-futures/) to provide annotated functions for authenticating and retrieving records from the Axiell Emu Collections Management System REST API.

At this time, the write options exposed by the Emu REST API are not supported by emudb-api-py.

---

## Requirements

- Python 3.14+
- Emu DB version 9.0+ (with REST API enabled and configured)

## Quickstart

Before anything else, you will need to get an Emu DB username and password, and determine the name of the Emu environment/tenant you want to connect to. Once you have those values, you can instantiate an `EmuAPIConnector`:
```python
from emudb_api_py import EmuAPIConnector

conn = EmuAPIConnector(
    # You may or may not need to provide the port the REST API listens on depending on 
    # the host is configured:
    host="https://host-name:port",
    user="your_username",
    pwd="your_password",
    tenant="museum",
)
```
Once your Connector is configured, the simplest way to begin making requests is by opening a `Session`:
```python
from emudb_api_py.schemas.emu.ecatalogue import EmuCatalogueItem

with conn.session() as sess:
    # If you pass the name of the resource to retrieve to Session.get, you will receive
    # a raw dictionary:
    record: dict[str, Any] | None = sess.get(12345, "ecatalogue")
    # Alternately, you can pass the approprite EmuSchema class to receive a validated
    # pydantic model:
    record: EmuCatalogueItem | None = sess.get(12345, EmuCatalogueItem)
```
The Connector also provides an async-ready version which mirrors most methods found on `Session`:
```python
from emudb_api_py.schemas.emu.ecatalogue import EmuCatalogueItem

async with conn.session_async() as sess:
    record: dict[str, Any] | None = await sess.get(12345, "ecatalogue")
    record: EmuCatalogueItem | None = awai tsess.get(12345, EmuCatalogueItem)
```

