https://github.com/hochfrequenz/malo-ident-python-models
Pydantic Model Classes for the EDI@Energy MaLo Ident API
https://github.com/hochfrequenz/malo-ident-python-models
bdew codegeneration edi-energy energiewirtschaft malo malo-id maloident marktkommunikation marktlokation openapi pydantic
Last synced: 25 days ago
JSON representation
Pydantic Model Classes for the EDI@Energy MaLo Ident API
- Host: GitHub
- URL: https://github.com/hochfrequenz/malo-ident-python-models
- Owner: Hochfrequenz
- License: mit
- Created: 2024-09-25T14:56:24.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-05-05T20:27:10.000Z (26 days ago)
- Last Synced: 2025-05-07T03:46:50.611Z (25 days ago)
- Topics: bdew, codegeneration, edi-energy, energiewirtschaft, malo, malo-id, maloident, marktkommunikation, marktlokation, openapi, pydantic
- Language: Python
- Homepage:
- Size: 116 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MaLo Ident Python Models
[](LICENSE)





This package provides mostly autogenerated [pydantic](https://docs.pydantic.dev/latest/)-based model classes for the MaLo ident API.
We also maintain a [C#/.NET Version of this data model](https://github.com/Hochfrequenz/malo-ident-net-models).
It does not provide you with an HTTP client.
## Installation
Install it from [PyPI](https://pypi.org/project/maloident)
```bash
pip install maloident
```Then use it:
```python
from maloident.v1.models import ResultNegativemy_json = {
"decisionTree": "E_0594",
"responseCode": "A10",
"reason": "Ich bin ein Freitext.",
"networkOperator": 9900987654321,
}
result = ResultNegative.model_validate(my_json)
```The request payload type for the Lieferant➡️Netzbetreiber identification request is `maloident.models.IdentificationParameter`.
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/edi-energy/MaLoIdent_2024-07-03/v1.0.0).Note that we fixed some errors in the official OpenAPI spec.
Our changes are mentioned at the beginning of the [`openapi.yml`](openapi/v1/openapi.yml) file.https://github.com/Hochfrequenz/malo-ident-python-models/blob/3cfe0aea3cff051303ef5e513d06ab6c5741f21a/openapi/openapi.yml#L4-L10
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.