efoli - EDIFACT Enums for German Utilities
raw JSON → 2.3.0 verified Fri May 01 auth: no python
Provides enums and helper functions modeling EDIFACT-relevant data for German utilities, including format versions, process types, and document types. Current version 2.3.0, requires Python >=3.9. Released under MIT license, maintained by Hochfrequenz. New releases appear every few months.
pip install efoli Common errors
error AttributeError: module 'efoli' has no attribute 'EDIFACTFormatVersion' ↓
cause Old import path after restructuring
fix
Use
from efoli import EDIFACTFormatVersion (top-level). error TypeError: expected string or bytes-like object ↓
cause Passing enum value directly where a string is expected
fix
Convert enum to string:
str(EDIFACTFormatVersion.FV2504) or fv.value. Warnings
breaking v2.0.0 broke UTILMDG/UTILMDS degeneracy: 44xxx now maps to UTILMDG, 55xxx to UTILMDS (not UTILMD). ↓
fix Update code if you relied on older mapping for 44xxx/55xxx document numbers.
gotcha Enum values like FV2504 have string representations (e.g., '2504'), not integers. ↓
fix Use .value or str() to get the string; do not assume integer.
Imports
- EDIFACTFormatVersion wrong
from efoli.enums import EDIFACTFormatVersioncorrectfrom efoli import EDIFACTFormatVersion - get_edifact_format_version_valid_from
from efoli import get_edifact_format_version_valid_from
Quickstart
from efoli import EDIFACTFormatVersion, get_edifact_format_version_valid_from
fv = EDIFACTFormatVersion.FV2504
print(fv)
print(get_edifact_format_version_valid_from(fv))