ssb-konjunk 0.1.14__tar.gz → 0.1.16__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.14 → ssb_konjunk-0.1.16}/PKG-INFO +2 -1
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/pyproject.toml +1 -3
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/statbank_format.py +11 -2
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/LICENSE +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/README.md +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/__init__.py +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/__main__.py +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/_functions.py +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/data_formating.py +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/fame.py +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/prompts.py +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/py.typed +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/rounding.py +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/saving.py +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/timestamp.py +0 -0
- {ssb_konjunk-0.1.14 → ssb_konjunk-0.1.16}/src/ssb_konjunk/xml_handling.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ssb-konjunk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.16
|
|
4
4
|
Summary: SSB Konjunk
|
|
5
5
|
Home-page: https://github.com/statisticsnorway/ssb-konjunk
|
|
6
6
|
License: MIT
|
|
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
17
|
Requires-Dist: click (>=8.0.1)
|
|
17
18
|
Requires-Dist: dapla-toolbelt (>=2.0.19,<3.0.0)
|
|
18
19
|
Requires-Dist: pandas (>=2.2.0,<3.0.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "ssb-konjunk"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.16"
|
|
4
4
|
description = "SSB Konjunk"
|
|
5
5
|
authors = ["Edvard Garmannslund <ged@ssb.no>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -96,8 +96,6 @@ select = [
|
|
|
96
96
|
"RUF", # the ruff developer's own rules
|
|
97
97
|
]
|
|
98
98
|
ignore = [
|
|
99
|
-
"ANN101", # Supress missing-type-self.
|
|
100
|
-
"ANN102", # Supress missing-type-cls.
|
|
101
99
|
"ANN202", # Don't requiere return type annotation for private functions.
|
|
102
100
|
"ANN401", # Allow type annotation with type Any.
|
|
103
101
|
"D100", # Supress undocumented-public-module. Only doc of public api required.
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import pandas as pd
|
|
2
2
|
|
|
3
|
+
from ssb_konjunk import prompts
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
def format_time_period(
|
|
5
|
-
df: pd.DataFrame,
|
|
7
|
+
df: pd.DataFrame,
|
|
8
|
+
year: int,
|
|
9
|
+
quarter: int | str = "",
|
|
10
|
+
col_name: str = "periode",
|
|
11
|
+
month: int | str = "",
|
|
6
12
|
) -> pd.DataFrame:
|
|
7
13
|
"""Add column with time period.
|
|
8
14
|
|
|
@@ -11,12 +17,15 @@ def format_time_period(
|
|
|
11
17
|
year: the year.
|
|
12
18
|
quarter: optional, default ''.
|
|
13
19
|
col_name: optional, default 'periode'. The name of the column for the time period.
|
|
20
|
+
month: optional, default ''.
|
|
14
21
|
|
|
15
22
|
Returns:
|
|
16
23
|
pd.DataFrame: dataframe with a column with time period.
|
|
17
24
|
"""
|
|
18
|
-
if quarter != "":
|
|
25
|
+
if quarter != "" and month == "":
|
|
19
26
|
df[col_name] = f"{year}K{int(quarter)}"
|
|
27
|
+
elif quarter == "" and month != "":
|
|
28
|
+
df[col_name] = f"{year}M{prompts.validate_month(month)}"
|
|
20
29
|
else:
|
|
21
30
|
df[col_name] = f"{year}"
|
|
22
31
|
|
|
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
|
|
File without changes
|