Skip to main content

makotest

Test and simulation toolkit for German market-communication (MaKo) platforms. It builds regulator-conformant EDIFACT, simulates the counterparties a platform talks to — answering in EDIFACT, late, or not at all — and asserts on both wire contracts: the messages and the CloudEvents stream. It targets mako but drives only public interfaces, so it can exercise any MaKo implementation.

pip install makotest                  # no runtime dependencies
pip install 'makotest[hypothesis]'    # + property-based strategies

Wheels are abi3 (abi3-py311): one wheel serves Python 3.11 and later.

Example

from makotest import antwort_obligation, malo_from_base, validate_edifact

malo_from_base("5123869601")  # '51238696012' — BDEW check digit applied

o = antwort_obligation(55001)  # what a Netzbetreiber owes on an Anmeldung
o.clock_time  # '11:00' — a clock time, not n × 24 h
o.due_at("2026-03-02T09:00:00Z")  # '2026-03-03T11:00:00+01:00'

validate_edifact(utilmd_bytes, "2026-10-01").is_valid  # MIG + AHB + semantic
def test_nb_bestaetigt(nb_sim, anmeldung):
    nb_sim.on(55001).bestaetigung(antwort_code="A51", ebd="E_0623")
    reply = nb_sim.receive(anmeldung, received_at="2026-03-02T09:00:00Z")

    assert reply.pid == 55002  # the AHB answer PID — never Anfrage + 1
    platform.ingest(reply.business)  # a rendered interchange, not a dict


def test_frist_faellt(nb_sim, anmeldung):
    nb_sim.on(55001).timeout()  # no answer, not even a CONTRL
    assert not nb_sim.receive(anmeldung)


def test_verspaetete_antwort(nb_sim, anmeldung):
    nb_sim.on(55001).bestaetigung(delay_werktage=3)  # right message, wrong day
    reply = nb_sim.receive(anmeldung, received_at="2026-03-02T09:00:00Z")
    assert reply.answered_at > reply.due_at

From a shell:

$ makotest validate inbound.edi --on 2026-04-01
$ makotest frist 55001 --received 2026-03-02T09:00:00Z
$ makotest id 9900357000004      # → satisfies NEITHER check-digit procedure
$ makotest codes --pid 55001     # what a counterparty may answer with

Design

Everything a regulator defines in a table is the platform's own Rust, bound through PyO3 — never reimplemented in Python:

Concern Home
EDIFACT build + MIG/AHB/semantic validation, release per format version Rust — edi-energy
Identifier check digits (MaLo, MP-ID, EIC, §8.2 resources) Rust — rubo4e
Werktag calendar, acknowledgement clocks, answer Fristen Rust — mako-fristen
Antwortcodes per Entscheidungsbaum Rust — mako-pruefung
CloudEvents type catalog and subscription matcher Rust — mako-events
Counterparty behaviour, EPEX curves, fixtures Python

Generators are seeded, clocks injected and the format version is an argument, so two runs produce byte-identical EDIFACT. Every validation report carries rules_applied, and every event assertion resolves its type against the platform's catalogue first — a check that matched nothing fails instead of passing. AssertionError means the system under test is wrong; ValueError means the test is.

pytest plugin

Registered through the pytest11 entry point:

Fixtures nb_sim, biko_sim, imsys_sim, epex, lastgang, frozen_clock, makotest_seed, makotest_on, mako_endpoint
Markers @pytest.mark.regulatory("GPKE Teil 2"), @pytest.mark.requires_docker
Options --makotest-on ISO_DATE, --makotest-seed N, --mako-endpoint URL

Development

makotest is a member of the mako Cargo workspace, built with maturin:

python3.11 -m venv .venv    # PYO3_PYTHON points here (.cargo/config.toml)
just test-makotest          # maturin develop + pytest
just lint-makotest          # ruff
just build-makotest         # release wheel

pyo3/extension-module is not a Cargo feature (maturin enables it), so cargo test --workspace --all-features still links.

The full reference — every builder, assertion, strategy and simulator, with the Fundstelle behind each rule — is makotest in the mako documentation.

Licence

MIT OR Apache-2.0, matching mako.

Metadata

Release files for makotest 0.24.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for makotest 0.24.4
File Size Uploaded Provenance Actions
makotest-0.24.4.tar.gz 2.2 MB With provenance Details for makotest-0.24.4.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for makotest 0.24.4
File Actions
makotest-0.24.4-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for makotest-0.24.4-cp311-abi3-win_amd64.whl
makotest-0.24.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for makotest-0.24.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
makotest-0.24.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for makotest-0.24.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
makotest-0.24.4-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for makotest-0.24.4-cp311-abi3-macosx_11_0_arm64.whl
makotest-0.24.4-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for makotest-0.24.4-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 13.5 MB

Release files / makotest-0.24.4.tar.gz

Download URL makotest-0.24.4.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
b12ccd1f241b969a1aae6abc3da8f1de03053e6b38ed2bd6668835e13ff07416
BLAKE2b-256 checksum
How to use checksums
e6dd1b2e0f23a0ab958bdcc29b9ebfb039228a22056e1cae3963a97694e7700b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / makotest-0.24.4-cp311-abi3-win_amd64.whl

Download URL makotest-0.24.4-cp311-abi3-win_amd64.whl
Size 2.2 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8c871119ef5ce5ca32ddd8922f6aefebfedd004dfcd0ee5565fcaf985794f6f6
BLAKE2b-256 checksum
How to use checksums
17992d4f68a42900a1913ca3d7e1151e1463b0d17ff1057d4e3f2a491ff0bbbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / makotest-0.24.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL makotest-0.24.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.3 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5a8db46de0b96dd47f8a6ca100cc71514fe0be752a5bc35cb8c21d47664a8d44
BLAKE2b-256 checksum
How to use checksums
334c9a22cc1ee89f81a44b6b26b07fd0f2ac9c6606b498b2c73641d4d72490b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / makotest-0.24.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL makotest-0.24.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.3 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ae9051a197a3ce91e2a57dfbb674e9c4c648230891e788acafc5bcc7b64137eb
BLAKE2b-256 checksum
How to use checksums
7ca4fb58ef125cab8671f8e1803f4bebf07ac790a0bcccc740c6a6b1a1dc5d76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / makotest-0.24.4-cp311-abi3-macosx_11_0_arm64.whl

Download URL makotest-0.24.4-cp311-abi3-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6e556ad7e3ce7c0d4a128b80ae387a2277c4d3ee3308f3430d35b777b4761c45
BLAKE2b-256 checksum
How to use checksums
1ab1984fdcc78f8c184c3c59fe241559ae3b08a5b91b20c6f80ce1988f712ed3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / makotest-0.24.4-cp311-abi3-macosx_10_12_x86_64.whl

Download URL makotest-0.24.4-cp311-abi3-macosx_10_12_x86_64.whl
Size 2.2 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
76246756aa86e2e4231ee0219d77467440fb46022bc1c74ff465e8a4b14914a8
BLAKE2b-256 checksum
How to use checksums
eb6c599822fb315722f75697c50dc685ec4b5ace24d94ecf1182f7bbe6f47682
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for makotest 0.24.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for makotest-0.24.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page