ssb-konjunk 0.1.18__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/saving.py +12 -0
- {ssb_konjunk-0.1.18.dist-info → ssb_konjunk-0.1.19.dist-info}/METADATA +1 -1
- {ssb_konjunk-0.1.18.dist-info → ssb_konjunk-0.1.19.dist-info}/RECORD +6 -6
- {ssb_konjunk-0.1.18.dist-info → ssb_konjunk-0.1.19.dist-info}/LICENSE +0 -0
- {ssb_konjunk-0.1.18.dist-info → ssb_konjunk-0.1.19.dist-info}/WHEEL +0 -0
- {ssb_konjunk-0.1.18.dist-info → ssb_konjunk-0.1.19.dist-info}/entry_points.txt +0 -0
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
|
|
@@ -6,12 +6,12 @@ ssb_konjunk/fame.py,sha256=6Yw0D1kY20yOu49DHgwfSIAmiHVCERuMeIANg1lYu64,1619
|
|
|
6
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
|
|
File without changes
|