https://github.com/hochfrequenz/verzeichnisdienst-python-models
Pydantic Model Classes for the EDI@Energy Verzeichnisdienst API
https://github.com/hochfrequenz/verzeichnisdienst-python-models
api bdew codegen edi-energy energiewirtschaft verzeichnisdienst
Last synced: 6 months ago
JSON representation
Pydantic Model Classes for the EDI@Energy Verzeichnisdienst API
- Host: GitHub
- URL: https://github.com/hochfrequenz/verzeichnisdienst-python-models
- Owner: Hochfrequenz
- Created: 2024-11-15T09:47:09.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-04-07T09:57:02.000Z (6 months ago)
- Last Synced: 2025-04-07T10:33:53.710Z (6 months ago)
- Topics: api, bdew, codegen, edi-energy, energiewirtschaft, verzeichnisdienst
- Language: Python
- Homepage:
- Size: 60.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Verzeichnisdienst Python Models
[](LICENSE)





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 ApiRecordmy_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 Contactmy_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.