Skip to content

Commit

Permalink
fix: switch position of to and from date in filename (#264)
Browse files Browse the repository at this point in the history
Co-authored-by: Konstantin <konstantin.klein+github@hochfrequenz.de>
  • Loading branch information
hf-kklein and Konstantin authored Jan 12, 2025
1 parent a4972ee commit c3c6241
Show file tree
Hide file tree
Showing 4 changed files with 1,278 additions and 1,268 deletions.
2 changes: 1 addition & 1 deletion src/edi_energy_scraper/apidocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def get_meaningful_file_name(self) -> str:
),
}
return (
"{kind}_{edifact_format}{version}_{to_date}_{from_date}_{publication_date}_{flags}_{id}.{extension}".format(
"{kind}_{edifact_format}{version}_{from_date}_{to_date}_{publication_date}_{flags}_{id}.{extension}".format(
**placeholder_values
)
)
Expand Down
2 changes: 1 addition & 1 deletion src/edi_energy_scraper/documentmetadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def from_filename(cls, file: Path | str) -> "DocumentMetadata":
is_consolidated_reading_version,
is_informational_reading_version,
) = [x.lower() == "x" for x in filename_parts[-2]]
valid_to, valid_from, publ_date = [
valid_from, valid_to, publ_date = [
datetime.strptime(fp, "%Y%m%d") for fp in [filename_parts[-5], filename_parts[-4], filename_parts[-3]]
]
version = None if filename_parts[-6] == "NV" else filename_parts[-6]
Expand Down
Loading

0 comments on commit c3c6241

Please sign in to comment.