Skip to main content

edi-energy.de scraper

License: MIT Unittests status badge Coverage status badge Linting status badge Black status badge PyPi Status Badge Python Versions (officially) supported

The Python package edi_energy_scraper provides easy to use methods to mirror the free documents on bdew-mako.de.

Rationale / Why?

If you'd like to be informed about new regulations or data formats being published on bdew-mako.de you can either

  • visit the site every day and hope that you see the changes if this is your favourite hobby,
  • or automate the task.

This repository helps you with the latter. It allows you to create an up-to-date copy of edi-energy.de on your local computer. Other than if you mirrored the files using wget or curl, you'll get a clean and intuitive directory structure.

From there you can e.g. commit the files into a VCS (like e.g. our edi_energy_mirror), scrape the PDF/Word files for later use...

We're all hoping for the day of true digitization on which this repository will become obsolete.

See also

There is a similar project in C# by Fabian Wetzel: fabsenet/edi-energy-extracto. Other than this project, it stores the downloaded data in a database instead of a file system. It also works with bdew-mako.de.

How to use the Package (as a user)

Install via pip:

pip install edi_energy_scraper

Create a directory in which you'd like to save the mirrored data:

mkdir edi_energy_de

Then import it and start the download:

import asyncio
from edi_energy_scraper import EdiEnergyScraper


# add the following lines to enable debug logging to stdout (CLI)
# import logging
# import sys
# logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)

async def mirror():
    scraper = EdiEnergyScraper(path_to_mirror_directory="edi_energy_de")
    await scraper.mirror()


if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    asyncio.run(mirror())

This creates a directory structure:

-|-your_script_cwd.py
 |-edi_energy_de
    |- FV2310 (contains files valid since 2023-10-01)
        |- ahb.pdf
        |- ahb.docx
        |- ...
    |- FV2404 (contains files valid since 2024-04-03)
        |- mig.pdf
        |- mig.docx
        |- ...
    |- FV2504 (contains files valid since 2025-06-06)
        |- allgemeine_festlegungen.pdf
        |- schema.xsd
        |- ...

[!TIP] You can extract the information encoded into the filenames:

from edi_energy_scraper import DocumentMetadata
structured_information = DocumentMetadata.from_filename("AHB_COMDIS_1.0f_99991231_20250605_20250605_8872.pdf")
# DocumentMetadata(kind='MIG', edifact_format=<EdifactFormat.REQOTE: 'REQOTE'>, valid_from=datetime.date(2023, 9, 30), valid_unt...traordinary_publication=True, is_error_correction=False, is_informational_reading_version=True, additional_text=None, id=10071)

## BDEW Anwendungshilfen / Aktivitätsdiagramme

Some documents (e.g. the BDEW-Anwendungshilfe **Aktivitätsdiagramme** for GPKE, WiM Strom, MPES
and MaBiS) are **not** part of the bdew-mako.de document API — they are published as plain
PDF/DOCX links on bdew.de service pages. `BdewAnwendungshilfenScraper` mirrors those: give it
one or more seed page URLs and it downloads every linked PDF/DOCX into a target directory,
keeping the original filenames.

`AKTIVITAETSDIAGRAMME_SEED_URLS` is a ready-made list of the current public pages (steady-state
GPKE/WiM/MPES/MaBiS **and** the 24h-supplier-switch / ZSG variant, LFW24). The superseded 2020
page and the login-walled Gas document (GeLi Gas 2.0, only reachable behind *BDEW
Authentifizierung*) are intentionally excluded.

```python
import asyncio
from edi_energy_scraper import AKTIVITAETSDIAGRAMME_SEED_URLS, BdewAnwendungshilfenScraper

async def mirror_anwendungshilfen():
    scraper = BdewAnwendungshilfenScraper()
    try:
        await scraper.download_from_seeds(
            list(AKTIVITAETSDIAGRAMME_SEED_URLS), target_directory="aktivitaetsdiagramme"
        )
    finally:
        await scraper.close()

asyncio.run(mirror_anwendungshilfen())

How to use this Repository on Your Machine (for development)

This repository uses uv for dependency management and development tooling. Install uv, then set up the development environment with:

uv sync --group dev

You can run the individual checks via the corresponding dependency groups, e.g.:

uv run --group tests pytest
uv run --group linting ruff check .
uv run --group type_check mypy --show-error-codes --strict src/edi_energy_scraper
uv run --group linting ruff format --check .

For general conventions, please also follow the instructions in our Python Template Repository.

Contribute

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

Download files

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

Source Distribution

edi_energy_scraper-2.5.2.tar.gz (145.3 kB view details)

Uploaded Source

Built Distribution

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

edi_energy_scraper-2.5.2-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file edi_energy_scraper-2.5.2.tar.gz.

File metadata

  • Download URL: edi_energy_scraper-2.5.2.tar.gz
  • Upload date:
  • Size: 145.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for edi_energy_scraper-2.5.2.tar.gz
Algorithm Hash digest
SHA256 0d0be26407158ad40fb5fd4f1c988be5c5852c7cf60fe3a4c92eb3942051f759
MD5 5fae814131dfa193605e19b146a1970b
BLAKE2b-256 34d7df12a4b0b1381321a5a35a6f5e776d70c6a5116bb321ca35568d0f317d2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for edi_energy_scraper-2.5.2.tar.gz:

Publisher: python-publish.yml on Hochfrequenz/edi_energy_scraper

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

File details

Details for the file edi_energy_scraper-2.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for edi_energy_scraper-2.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c9db3b804892c560cbecf0079443b1eda99ccd13046b3e246dd7a4b871362af
MD5 2c1c3cb5ad57643a071febba986aff63
BLAKE2b-256 302a0bf7d7b21dbe5b99673ed6c5f13b9ae88556af2572b6c71dd164c2283e97

See more details on using hashes here.

Provenance

The following attestation bundles were made for edi_energy_scraper-2.5.2-py3-none-any.whl:

Publisher: python-publish.yml on Hochfrequenz/edi_energy_scraper

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

Release history Release notifications | RSS feed

2.6.1

2 files

2.6.0

2 files

This release

2.5.2 This release

2 files

2.5.1

2 files

2.5.0

2 files

2.4.2

2 files

2.4.0

2 files

2.3.0

2 files

2.2.3

2 files

2.2.0

2 files

2.1.0

2 files

2.0.8

2 files

2.0.7

2 files

2.0.6

2 files

2.0.5

2 files

2.0.4

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.0.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.0

2 files

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