ssb-konjunk 0.1.12__tar.gz → 0.1.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/PKG-INFO +1 -1
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/pyproject.toml +1 -1
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/prompts.py +21 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/saving.py +3 -1
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/LICENSE +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/README.md +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/__init__.py +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/__main__.py +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/_functions.py +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/data_formating.py +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/fame.py +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/py.typed +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/rounding.py +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/statbank_format.py +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/timestamp.py +0 -0
- {ssb_konjunk-0.1.12 → ssb_konjunk-0.1.14}/src/ssb_konjunk/xml_handling.py +0 -0
|
@@ -335,3 +335,24 @@ def publishing_date() -> str:
|
|
|
335
335
|
date = set_publishing_date()
|
|
336
336
|
ok_date = check_publishing_date(date)
|
|
337
337
|
return ok_date
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
def get_previous_month(year: str | int, month: str | int) -> list[int]:
|
|
341
|
+
"""Turn e.g. month 01 year 2023 into month 12 and year 2022.
|
|
342
|
+
|
|
343
|
+
Args:
|
|
344
|
+
year: the current year YYYY.
|
|
345
|
+
month: the current month MM.
|
|
346
|
+
|
|
347
|
+
Returns:
|
|
348
|
+
list[int]: the previous month with year.
|
|
349
|
+
"""
|
|
350
|
+
prev_month = int(month) - 1
|
|
351
|
+
|
|
352
|
+
if prev_month != 0:
|
|
353
|
+
prev_year = int(year)
|
|
354
|
+
else:
|
|
355
|
+
prev_month = 12
|
|
356
|
+
prev_year = int(year) - 1
|
|
357
|
+
|
|
358
|
+
return [prev_year, prev_month]
|
|
@@ -87,7 +87,7 @@ def _structure_ssb_filepath(
|
|
|
87
87
|
|
|
88
88
|
# Handle versionizing or not.
|
|
89
89
|
if version_number is None:
|
|
90
|
-
file_path = f"{file_path}/{file_name}_{time_stamp}"
|
|
90
|
+
file_path = f"{file_path}/{file_name}_{time_stamp}_"
|
|
91
91
|
elif isinstance(version_number, int):
|
|
92
92
|
file_path = f"{file_path}/{file_name}_{time_stamp}_v{version_number}.{filetype}"
|
|
93
93
|
else:
|
|
@@ -324,6 +324,8 @@ def write_ssb_file(
|
|
|
324
324
|
version_number = _find_version_number(files, stable_version)
|
|
325
325
|
|
|
326
326
|
if version_number:
|
|
327
|
+
if file_path.endswith("_"):
|
|
328
|
+
file_path = file_path[:-1]
|
|
327
329
|
file_path = f"{file_path}_v{version_number}.{filetype}"
|
|
328
330
|
|
|
329
331
|
_save_df(df, file_path, filetype, fs, seperator, encoding)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|