Skip to main content

Tool to generate machine readable files from MIG documents

Project description

migmose-logo

MIG_mose

License: MIT Python Versions (officially) supported Pypi status badge Unittests status badge Coverage status badge Linting status badge Black status badge

MIG_mose generates machine-readable files from MIG .docx documents (edi-energy). MIG_mose is the sister of kohlrahbi.

If you're looking for a tool to process the official BDEW XMLs for MIGs (available since 2024), checkout fundamend.

Tech-Stack

  • MIG_mose is a Python(3.11,3.12) project.
  • .docx files a processed by the python-docx library.
  • EdiFact formats are used as in efoli).
  • syrupy for unittest snapshots

Installation

MIG_mose is a Python-based tool. Therefore, you have to make sure, that Python is running on your machine.

We recommend using virtual environments to keep your system clean.

Create a new virtual environment with

python -m venv .venv

The activation of the virtual environment depends on your used OS.

Windows

.venv\Scripts\activate

MacOS/Linux

source .venv/bin/activate

Finally, install the package with

pip install migmose

Features And How To Use Them

At this point, MIG_mose works as a command-line interface tool (CLI). There are several flags available to provide a user-friendly way to interact with MIG_mose. Below the available options are listed:

  • Input Directory (-eemp, --edi-energy-mirror-path):

    • Description: This option allows the user to specify the path to a edi-energy-mirror-like repository which contains .docx files for the MIGs (Message Implementation Guides) in subdirectories structured by the format version.
    • Example: --edi-energy-mirror-path /path/to/edi_energy_mirror
  • Message Format (-mf, --message-format):

    • Description: This option defines the set of message formats to be parsed. Users can specify multiple message formats by providing multiple values. The formats are EdiFact formats (cf. efoli.EdifactFormat). If no format is specified, all formats are parsed.
    • Example: --message_format "UTILMD" --message_format "ORDCHG"
  • Output Directory (-o, --output-dir):

    • Description: This option allows the user to specify the path to the directory which should contain the output files generated by the tool. If the directory does not exist, it will be created automatically.
    • Example: --output_dir /path/to/output_directory
  • Output File Type (-ft, --file-type):

    • Description: Defines the output format. Choose between (Default is csv):
      • csv for flat Nachrichtenstruktur tables
      • nested_json for json files of the nested Nachrichtenstruktur tables
      • reduced_nested_json for a reduced nested Nachrichtenstruktur
      • sgh_json for segmentgrouphierarchy files (cf. MAUS sgh)
      • tree for .tree files (cf. MAUS tree)
    • Example: `--file-type "csv"
  • Format Version (-fv, --format-version):

    • Description: Defines the format version.
    • Example: `--format-version "FV2310"

Usage Example

To use the CLI logic provided by this tool, follow the command syntax below:

migmose -eemp /path/to/edi_energy_mirror -o /path/to/output_directory -mf "UTILMD" -mf "ORDCHG" -ft "csv" -fv "FV2310"

Development

Setup

To set up the development environment, you have to install the dev dependencies.

tox -e dev

Run all tests and linters

To run the tests, you can use tox.

tox

To update the test snapshots run

tox -e update_snapshots

See our Python Template Repository for detailed explanations.

Contribute

You are very welcome to contribute to this template repository by opening a pull request against the main branch.

Related Tools and Context

This repository is part of the Hochfrequenz Libraries and Tools for a truly digitized market communication.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

migmose-0.2.6.tar.gz (397.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

migmose-0.2.6-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file migmose-0.2.6.tar.gz.

File metadata

  • Download URL: migmose-0.2.6.tar.gz
  • Upload date:
  • Size: 397.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for migmose-0.2.6.tar.gz
Algorithm Hash digest
SHA256 3ce0c5ca8de49e529cc09864a4bfc534c664584c5c53352e3cee042d7bd2b7cd
MD5 f3934397f57db4e2038e5bfc73738761
BLAKE2b-256 e5d1a5de76a0c39155679280694aeafb2f04136dd79d5558aeff88ebcbb430bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for migmose-0.2.6.tar.gz:

Publisher: python-publish.yml on Hochfrequenz/migmose

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file migmose-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: migmose-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for migmose-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8d876fe4cd72ce6838c3acfbb5d10ea4e6f809c44fdd3befbd51322840b78c42
MD5 8bfade94b3f6cdacc4a26e0ce9d21e13
BLAKE2b-256 12be7c2e0220542e1fc1d47ae3b138e553a3df4c2af6eb4a227dba19afe70cdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for migmose-0.2.6-py3-none-any.whl:

Publisher: python-publish.yml on Hochfrequenz/migmose

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page