Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kohlrahbi needs to under stand the new edi-energy-scraper (>=v2) naming schema #559

Open
hf-kklein opened this issue Jan 30, 2025 · 1 comment · May be fixed by #563
Open

kohlrahbi needs to under stand the new edi-energy-scraper (>=v2) naming schema #559

hf-kklein opened this issue Jan 30, 2025 · 1 comment · May be fixed by #563
Assignees
Labels
bug Something isn't working

Comments

@hf-kklein
Copy link
Contributor

File "/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/kohlrahbi/ahb/init.py", line 296, in scrape_pruefis
pruefi_to_file_mapping = get_pruefi_to_file_mapping(
basic_input_path=basic_input_path, format_version=format_version
)
File "/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/kohlrahbi/ahb/init.py", line 232, in get_pruefi_to_file_mapping
pruefi_to_file_mapping = find_pruefidentifikatoren(path_to_docx_files)
File "/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/kohlrahbi/ahb/init.py", line 162, in find_pruefidentifikatoren
ahb_file_finder.filter_for_latest_ahb_docx_files()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/kohlrahbi/docxfilefinder.py", line 172, in filter_for_latest_ahb_docx_files
self.paths_to_docx_files = self.filter_latest_version(grouped_files)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/kohlrahbi/docxfilefinder.py", line 246, in filter_latest_version
most_recent_file = get_most_recent_file(group_items)
File "/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/kohlrahbi/docxfilefinder.py", line 125, in get_most_recent_file
list_of_edi_energy_documents = [EdiEnergyDocument.from_path(path) for path in group_items]
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/kohlrahbi/docxfilefinder.py", line 35, in from_path
assert file_name is not None, f"Could not extract document version and valid dates from {path.name}."
^^^^^^^^^^^^^^^^^^^^^
AssertionError: Could not extract document version and valid dates from AHB_COMDIS_1.0f_20250606_99991231_20250606_ooox_8871.docx.

edi-energy-scraper introduced a new naming schema with the beginning of 2025 (EOL edi-energy.de/Go Live bdew-mako.de)

@hf-kklein hf-kklein added the bug Something isn't working label Jan 30, 2025
@hf-kklein
Copy link
Contributor Author

the fix will be, to use this method:
https://github.com/Hochfrequenz/edi_energy_scraper/blob/fe8bf9b04b8e05ce5f0a18e4c22fa36a34e017ad/src/edi_energy_scraper/documentmetadata.py#L39-L40

it returns you properly typed metadata about each file there is.

@hf-krechan hf-krechan linked a pull request Feb 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants