ssb-konjunk 0.1.17__py3-none-any.whl → 0.1.19__py3-none-any.whl
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/prompts.py +3 -2
- ssb_konjunk/saving.py +12 -0
- {ssb_konjunk-0.1.17.dist-info → ssb_konjunk-0.1.19.dist-info}/METADATA +7 -7
- {ssb_konjunk-0.1.17.dist-info → ssb_konjunk-0.1.19.dist-info}/RECORD +7 -7
- {ssb_konjunk-0.1.17.dist-info → ssb_konjunk-0.1.19.dist-info}/WHEEL +1 -1
- {ssb_konjunk-0.1.17.dist-info → ssb_konjunk-0.1.19.dist-info}/LICENSE +0 -0
- {ssb_konjunk-0.1.17.dist-info → ssb_konjunk-0.1.19.dist-info}/entry_points.txt +0 -0
ssb_konjunk/prompts.py
CHANGED
|
@@ -271,7 +271,7 @@ def validate_day(day: int | str) -> str:
|
|
|
271
271
|
day = "0" + str(int(day))
|
|
272
272
|
return str(day)
|
|
273
273
|
|
|
274
|
-
|
|
274
|
+
|
|
275
275
|
def quarter_for_month(month: str | int) -> int:
|
|
276
276
|
"""Find corresponding quarter for a month.
|
|
277
277
|
|
|
@@ -325,6 +325,7 @@ def months_in_quarter(quarter: int | str) -> list[int]:
|
|
|
325
325
|
else:
|
|
326
326
|
return [10, 11, 12]
|
|
327
327
|
|
|
328
|
+
|
|
328
329
|
def set_publishing_date() -> str:
|
|
329
330
|
"""Set the date for publication of tables.
|
|
330
331
|
|
|
@@ -408,4 +409,4 @@ def get_previous_month(year: str | int, month: str | int) -> list[int]:
|
|
|
408
409
|
prev_month = 12
|
|
409
410
|
prev_year = int(year) - 1
|
|
410
411
|
|
|
411
|
-
return [prev_year, prev_month]
|
|
412
|
+
return [prev_year, prev_month]
|
ssb_konjunk/saving.py
CHANGED
|
@@ -257,6 +257,14 @@ def _save_df(
|
|
|
257
257
|
f.close()
|
|
258
258
|
else:
|
|
259
259
|
df.to_csv(file_path, sep=seperator, index=False, encoding=encoding)
|
|
260
|
+
# Save as jsonl
|
|
261
|
+
elif filetype == "jsonl":
|
|
262
|
+
df.to_json(orient="records", lines=True)
|
|
263
|
+
|
|
264
|
+
# Save as json
|
|
265
|
+
elif filetype == "json":
|
|
266
|
+
df.to_json(orient="records", lines=False)
|
|
267
|
+
|
|
260
268
|
# Uknown filetype sent as argument
|
|
261
269
|
else:
|
|
262
270
|
raise ValueError(
|
|
@@ -407,5 +415,9 @@ def read_ssb_file(
|
|
|
407
415
|
df = pd.read_csv(file_path, sep=seperator, encoding=encoding)
|
|
408
416
|
elif filetype == "parquet":
|
|
409
417
|
df = pd.read_parquet(file_path, filesystem=fs)
|
|
418
|
+
elif filetype == "jsonl":
|
|
419
|
+
df = pd.read_json(file_path, lines=True)
|
|
420
|
+
elif filetype == "json":
|
|
421
|
+
df = pd.read_json(file_path, lines=False)
|
|
410
422
|
# Returns pandas df.
|
|
411
423
|
return df
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: ssb-konjunk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.19
|
|
4
4
|
Summary: SSB Konjunk
|
|
5
|
-
Home-page: https://github.com/statisticsnorway/ssb-konjunk
|
|
6
5
|
License: MIT
|
|
7
6
|
Author: Edvard Garmannslund
|
|
8
7
|
Author-email: ged@ssb.no
|
|
@@ -15,12 +14,13 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
16
|
Requires-Dist: click (>=8.0.1)
|
|
18
|
-
Requires-Dist: dapla-toolbelt (>=2.0.
|
|
19
|
-
Requires-Dist: pandas (>=2.2.0
|
|
20
|
-
Requires-Dist: pandas-stubs (>=2.2.2.240807
|
|
21
|
-
Requires-Dist: pendulum (>=3.0.0
|
|
17
|
+
Requires-Dist: dapla-toolbelt (>=2.0.20)
|
|
18
|
+
Requires-Dist: pandas (>=2.2.0)
|
|
19
|
+
Requires-Dist: pandas-stubs (>=2.2.2.240807)
|
|
20
|
+
Requires-Dist: pendulum (>=3.0.0)
|
|
22
21
|
Project-URL: Changelog, https://github.com/statisticsnorway/ssb-konjunk/releases
|
|
23
22
|
Project-URL: Documentation, https://statisticsnorway.github.io/ssb-konjunk
|
|
23
|
+
Project-URL: Homepage, https://github.com/statisticsnorway/ssb-konjunk
|
|
24
24
|
Project-URL: Repository, https://github.com/statisticsnorway/ssb-konjunk
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
|
|
@@ -3,15 +3,15 @@ ssb_konjunk/__main__.py,sha256=bqGEjbMKlKza1kQeyZ5NcjV5p5vsGpoQ81YhO8cGPvk,213
|
|
|
3
3
|
ssb_konjunk/_functions.py,sha256=Dp39rEMqR0M43o4mCujoRzlSyT_rHYcK6VHHc9wSY8E,470
|
|
4
4
|
ssb_konjunk/data_formating.py,sha256=7GcDS_wsHWzCNJg4wpj-zFRWYX0c1KAB4FcbxZ9Ez4A,627
|
|
5
5
|
ssb_konjunk/fame.py,sha256=6Yw0D1kY20yOu49DHgwfSIAmiHVCERuMeIANg1lYu64,1619
|
|
6
|
-
ssb_konjunk/prompts.py,sha256=
|
|
6
|
+
ssb_konjunk/prompts.py,sha256=tGI2dARh8jIYB_IZ4Iwb5AEbNoDZq9-17Uc9QjhqPcQ,10269
|
|
7
7
|
ssb_konjunk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
ssb_konjunk/rounding.py,sha256=nbxYMvvFzoJOxwJBCA80OyaZGhhOHCxbndeYB271Uzk,1269
|
|
9
|
-
ssb_konjunk/saving.py,sha256=
|
|
9
|
+
ssb_konjunk/saving.py,sha256=NXqKj1ID-EGH76AOWSJKZIll2QJoOtMWnImKZQ6cNTw,14924
|
|
10
10
|
ssb_konjunk/statbank_format.py,sha256=cVXrq2qSuMk-FAiMdbIS8Cc8YgZUyTCKnsMdknMbfkM,1469
|
|
11
11
|
ssb_konjunk/timestamp.py,sha256=XPB5JhZQdDgUPYYNVAFiMZGe8dYL8seb_k98G9CNtjY,9960
|
|
12
12
|
ssb_konjunk/xml_handling.py,sha256=kvAZ699iOSxHCi2ksEGroFk60-ufsRW7b_m3j47A2gY,1726
|
|
13
|
-
ssb_konjunk-0.1.
|
|
14
|
-
ssb_konjunk-0.1.
|
|
15
|
-
ssb_konjunk-0.1.
|
|
16
|
-
ssb_konjunk-0.1.
|
|
17
|
-
ssb_konjunk-0.1.
|
|
13
|
+
ssb_konjunk-0.1.19.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
|
|
14
|
+
ssb_konjunk-0.1.19.dist-info/METADATA,sha256=thAiVXYtdJYEQPT1bWEYv58_e3AkI5B4e7FzkpjuQaY,3948
|
|
15
|
+
ssb_konjunk-0.1.19.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
16
|
+
ssb_konjunk-0.1.19.dist-info/entry_points.txt,sha256=qU7y58sZiFKYonuEJTbV0MhhbAJtposy46crLp4TjAM,57
|
|
17
|
+
ssb_konjunk-0.1.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|