Fundamend
raw JSON → 0.36.0 verified Fri May 01 auth: no python
Python library for XML-based formats and data models for the German energy industry (Energiewirtschaft). Provides Pydantic models and tooling for MIGs, AHBs, and related standards. Latest version: 0.36.0. Actively developed with frequent releases.
pip install fundamend Common errors
error AttributeError: module 'fundamend' has no attribute 'Mig' ↓
cause Using an outdated version (<0.30.0) or importing from wrong submodule.
fix
Run
pip install --upgrade fundamend and use from fundamend import Mig. error pydantic.error_wrappers.ValidationError: 1 validation error for Mig ↓
cause XML file does not conform to the expected schema (e.g., missing mandatory fields).
fix
Validate your XML against the official MIG/AHB schema. Check for missing tags or incorrect namespaces.
Warnings
breaking Version 0.34.0 changed the `id_path` construction to use semantic qualifiers. If you rely on stable string ID paths, they may have changed. ↓
fix Recompute any persisted ID paths; the new format is more stable across XML versions.
deprecated Direct import from submodules (e.g., `from fundamend.models import ...`) is deprecated. Use top-level imports instead. ↓
fix Change to `from fundamend import Mig` or the relevant class.
gotcha XML files must use UTF-8 encoding. Non-UTF-8 files may cause parsing errors, especially with German umlauts. ↓
fix Ensure XML files are saved with UTF-8 encoding before loading.
Imports
- Mig wrong
from fundamend.models import Migcorrectfrom fundamend import Mig - Ahb wrong
from fundamend.ahb import Ahbcorrectfrom fundamend import Ahb
Quickstart
from fundamend import Mig
# Load a MIG from a local XML file
mig = Mig.from_xml("path/to/mig.xml")
print(mig.title)
# Load an AHB from XML
from fundamend import Ahb
ahb = Ahb.from_xml("path/to/ahb.xml")
print(ahb.name)