Metadata-Version: 2.4
Name: maloident
Version: 2026.7.1.1
Summary: Model classes for the Marktlokation ID Identification API by EDI@Energy (manually fixed)
Project-URL: Changelog, https://github.com/Hochfrequenz/malo-ident-python-models/releases
Project-URL: Homepage, https://github.com/Hochfrequenz/malo-ident-python-models
Author-email: your name <info+github@hochfrequenz.de>
License: MIT
License-File: LICENSE
Keywords: BDEW,MaLo,MaLo Ident,Marktlokation
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
Description-Content-Type: text/markdown

# MaLo Ident Python Models

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
![Python Versions (officially) supported](https://img.shields.io/pypi/pyversions/maloident.svg)
![Pypi status badge](https://img.shields.io/pypi/v/maloident)
![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 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 ResultNegative

my_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 (this requires Python >=3.10, since `datamodel-code-generator` dropped support for Python 3.9)

```bash
uv sync --group codegen
uv run datamodel-codegen --encoding utf-8 --input openapi/v1/openapi.yml --output src/maloident/v1/_autogenerated.py --input-file-type openapi --output-model-type pydantic_v2.BaseModel --output-datetime-class AwareDatetime
uv run black src/maloident/v1/_autogenerated.py
uv run isort src/maloident/v1/_autogenerated.py
```

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.
