Metadata-Version: 2.3
Name: verzeichnisdienst
Version: 0.1.0
Summary: Model classes for the Verzeichnisdienst API by EDI@Energy
Project-URL: Changelog, https://github.com/Hochfrequenz/verzeichnisdienst-python-models/releases
Project-URL: Homepage, https://github.com/Hochfrequenz/verzeichnisdienst-python-models
Author-email: your name <info+github@hochfrequenz.de>
License: MIT
Keywords: BDEW,EDI@Energy,Verzeichnisdienst
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Requires-Dist: pydantic>=2
Provides-Extra: codegen
Requires-Dist: datamodel-code-generator==0.26.3; extra == 'codegen'
Provides-Extra: coverage
Requires-Dist: coverage==7.6.7; extra == 'coverage'
Provides-Extra: dev
Requires-Dist: pip-tools; extra == 'dev'
Provides-Extra: formatting
Requires-Dist: black==24.10.0; extra == 'formatting'
Requires-Dist: isort==5.13.2; extra == 'formatting'
Provides-Extra: linting
Requires-Dist: pylint==3.3.1; extra == 'linting'
Provides-Extra: packaging
Requires-Dist: build==1.2.2.post1; extra == 'packaging'
Requires-Dist: twine==5.1.1; extra == 'packaging'
Provides-Extra: spell-check
Requires-Dist: codespell==2.3.0; extra == 'spell-check'
Provides-Extra: tests
Requires-Dist: pytest==8.3.3; extra == 'tests'
Provides-Extra: type-check
Requires-Dist: mypy[pydantic]==1.13.0; extra == 'type-check'
Description-Content-Type: text/markdown

# Verzeichnisdienst Python Models

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
![Python Versions (officially) supported](https://img.shields.io/pypi/pyversions/verzeichnisdienst.svg)
![Pypi status badge](https://img.shields.io/pypi/v/verzeichnisdienst)
![Unittests status badge](https://github.com/Hochfrequenz/malo-ident-python-models/workflows/Unittests/badge.svg)
![Coverage status badge](https://github.com/Hochfrequenz/malo-ident-python-models/workflows/Coverage/badge.svg)
![Linting status badge](https://github.com/Hochfrequenz/malo-ident-python-models/workflows/Linting/badge.svg)
![Black status badge](https://github.com/Hochfrequenz/malo-ident-python-models/workflows/Formatting/badge.svg)

This package provides mostly autogenerated [pydantic](https://docs.pydantic.dev/latest/)-based model classes for the Verzeichnisdienst API.

It does not provide you with an HTTP client.

## Installation

Install it from [PyPI](https://pypi.org/project/verzeichnisdienst)

```bash
pip install verzeichnisdienst
```

Then use it:

```python
from verzeichnisdienst.v1.models import ApiRecord

my_json = {
    "providerId": "1234567890123",
    "apiId": "example",
    "majorVersion": 1,
    "url": "https://www.example.org/api/resource/v1",
    "additionalMetadata": None,
    "lastUpdated": "2024-10-01T00:00:00+00:00",
    "revision": 1,
    "status": "Test",
}
my_strongly_typed_record = ApiRecord.model_validate(my_json)
```

or

```python
from verzeichnisdienst.v1.websocket import Contact

my_json_contact = {
    "email": "verzeichnis@hochfrequenz.de",
    "phone": "0049123457890"
}
my_strongly_typed_contact = Contact.model_validate(my_json_contact)
```

See the [tests](unittests/test_models.py) for more examples.

## Project Structure

This project is based on [`datamodel-code-generator`](https://github.com/koxudaxi/datamodel-code-generator/).
Most of the classes are autogenerated from the [`openapi.yml`](openapi/v1/openapi.yml) which can be found on [SwaggerHub](https://app.swaggerhub.com/apis-docs/edi_energy/Verzeichnisdienst_Web-API_2024_10_01/1.0.0).

After updating the `openapi.yml` file, use

```bash
tox -e codegen
```

to re-generate the model classes.

## Contribute

You are very welcome to contribute to this template repository by opening a pull request against the main branch.
