etlplus 0.12.3__py3-none-any.whl → 0.12.5__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.
etlplus/file/core.py CHANGED
@@ -19,6 +19,7 @@ from . import json
19
19
  from . import ndjson
20
20
  from . import orc
21
21
  from . import parquet
22
+ from . import stub
22
23
  from . import tsv
23
24
  from . import txt
24
25
  from . import xls
@@ -209,6 +210,8 @@ class File:
209
210
  return orc.read(self.path)
210
211
  case FileFormat.PARQUET:
211
212
  return parquet.read(self.path)
213
+ case FileFormat.STUB:
214
+ return stub.read(self.path)
212
215
  case FileFormat.TSV:
213
216
  return tsv.read(self.path)
214
217
  case FileFormat.TXT:
@@ -270,6 +273,8 @@ class File:
270
273
  return orc.write(self.path, data)
271
274
  case FileFormat.PARQUET:
272
275
  return parquet.write(self.path, data)
276
+ case FileFormat.STUB:
277
+ return stub.write(self.path, data)
273
278
  case FileFormat.TSV:
274
279
  return tsv.write(self.path, data)
275
280
  case FileFormat.TXT:
etlplus/file/enums.py CHANGED
@@ -69,6 +69,7 @@ class FileFormat(CoercibleStrEnum):
69
69
  NDJSON = 'ndjson'
70
70
  ORC = 'orc'
71
71
  PARQUET = 'parquet'
72
+ STUB = 'stub'
72
73
  TSV = 'tsv'
73
74
  TXT = 'txt'
74
75
  XLS = 'xls'
@@ -104,6 +105,7 @@ class FileFormat(CoercibleStrEnum):
104
105
  '.orc': 'orc',
105
106
  '.parquet': 'parquet',
106
107
  '.pq': 'parquet',
108
+ '.stub': 'stub',
107
109
  '.tsv': 'tsv',
108
110
  '.txt': 'txt',
109
111
  '.xls': 'xls',
etlplus/file/stub.py ADDED
@@ -0,0 +1,75 @@
1
+ """
2
+ :mod:`etlplus.file.stub` module.
3
+
4
+ Helpers for reading/writing stubbed files.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+ from ..types import JSONList
13
+
14
+ # SECTION: EXPORTS ========================================================== #
15
+
16
+
17
+ __all__ = [
18
+ 'read',
19
+ 'write',
20
+ ]
21
+
22
+
23
+ # SECTION: FUNCTIONS ======================================================== #
24
+
25
+
26
+ def read(
27
+ path: Path,
28
+ ) -> JSONList:
29
+ """
30
+ Read stubbed content from ``path``.
31
+
32
+ Parameters
33
+ ----------
34
+ path : Path
35
+ Path to the stubbed file on disk.
36
+
37
+ Returns
38
+ -------
39
+ JSONList
40
+ The list of dictionaries read from the stubbed file.
41
+
42
+ Raises
43
+ ------
44
+ NotImplementedError
45
+ Always, since this is a stub implementation.
46
+ """
47
+ raise NotImplementedError('Stubbed read is not implemented yet')
48
+
49
+
50
+ def write(
51
+ path: Path,
52
+ data: JSONData,
53
+ ) -> int:
54
+ """
55
+ Write ``data`` to stubbed file at ``path`` and return record count.
56
+
57
+ Parameters
58
+ ----------
59
+ path : Path
60
+ Path to the stubbed file on disk.
61
+ data : JSONData
62
+ Data to write as stubbed file. Should be a list of dictionaries or a
63
+ single dictionary.
64
+
65
+ Returns
66
+ -------
67
+ int
68
+ The number of rows written to the stubbed file.
69
+
70
+ Raises
71
+ ------
72
+ NotImplementedError
73
+ Always, since this is a stub implementation.
74
+ """
75
+ raise NotImplementedError('Stubbed write is not implemented yet')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: etlplus
3
- Version: 0.12.3
3
+ Version: 0.12.5
4
4
  Summary: A Swiss Army knife for simple ETL operations
5
5
  Home-page: https://github.com/Dagitali/ETLPlus
6
6
  Author: ETLPlus Team
@@ -60,15 +60,16 @@ etlplus/file/__init__.py,sha256=X03bosSM-uSd6dh3ur0un6_ozFRw2Tm4PE6kVUjtXK8,475
60
60
  etlplus/file/_io.py,sha256=kSbe4Bc9J8br7g856IzBvmKIWSSlng8vo66XN9Z2aiw,2917
61
61
  etlplus/file/_pandas.py,sha256=6ZqU7QzEMBq7OFl3mfEtotnKunpS3XV_GGRgz7SIHsI,1282
62
62
  etlplus/file/avro.py,sha256=JHK95zrwuHHICRe8f20xfKmeWzv1wP0Br5pOnINdLSc,4621
63
- etlplus/file/core.py,sha256=BkCliUez8SBEgpagxSeDbJixnX9QvD5XQp0dbYOOw0k,8692
63
+ etlplus/file/core.py,sha256=HjxCypAJ7amPKeJdonxPx7DAXxRR59lsK8PF2T516Mk,8874
64
64
  etlplus/file/csv.py,sha256=gtEUWJO54veEtgaLB_QnmR8yOpeToq78nrtAPVTTl44,1269
65
- etlplus/file/enums.py,sha256=rwrbwj6PejG0c5v6jzcsmeNu9cSqDyWB1foIuM5UyJo,6648
65
+ etlplus/file/enums.py,sha256=PKS-vkyYhS7YOXBTPLjy_PNhB8BOXDwZG5hMK8UMqwQ,6695
66
66
  etlplus/file/feather.py,sha256=WYZBn2f_Z7KDZZJ1eX0RS-934MnYIMydD0p2Oo30do4,2182
67
67
  etlplus/file/gz.py,sha256=NKsvIV7TIWn8USbvuZmRH9hr6OrXh4TzTfDykHD41Kk,2631
68
68
  etlplus/file/json.py,sha256=_KAXb4rZ1C8xnaV10IkihuFh1lhbWvajFOlMrBCNVjQ,2099
69
69
  etlplus/file/ndjson.py,sha256=gT-kgcqCUUSxtm2j-JMejoh65jk-njMvFwxKCquLZw0,2393
70
70
  etlplus/file/orc.py,sha256=GUrq9rgXCLBJ0i8Jd0Xsl4DzldDBg0FDxYhytb4OgxQ,2139
71
71
  etlplus/file/parquet.py,sha256=Tp2bi_PAIUdkzc25nArJp7beuUaudw5NdciV6IFHsdQ,2281
72
+ etlplus/file/stub.py,sha256=N5k7uQk78sD5KfgayNJ2plmSn3GGRT31B5WRzH8_ZFw,1485
72
73
  etlplus/file/tsv.py,sha256=NiqF84Ck8e_DinaiO8yKRR6fVUTnUhpThzo4E1QUD8k,1271
73
74
  etlplus/file/txt.py,sha256=BStC7crpkGT4qddEeAD1_1mi_2-vQSXLj2DI-ddPFQE,2206
74
75
  etlplus/file/xls.py,sha256=83BbBJGxHAdbKH8Imz1l4mOgQT34uo-tyujp2WONRY4,1771
@@ -83,9 +84,9 @@ etlplus/templates/view.sql.j2,sha256=Iy8DHfhq5yyvrUKDxqp_aHIEXY4Tm6j4wT7YDEFWAhk
83
84
  etlplus/validation/README.md,sha256=qusyiyJu2DsaK80jlwfXVZ0iDgeuTPOX2EL3a_fcFiw,1401
84
85
  etlplus/validation/__init__.py,sha256=Pe5Xg1_EA4uiNZGYu5WTF3j7odjmyxnAJ8rcioaplSQ,1254
85
86
  etlplus/validation/utils.py,sha256=Mtqg449VIke0ziy_wd2r6yrwJzQkA1iulZC87FzXMjo,10201
86
- etlplus-0.12.3.dist-info/licenses/LICENSE,sha256=MuNO63i6kWmgnV2pbP2SLqP54mk1BGmu7CmbtxMmT-U,1069
87
- etlplus-0.12.3.dist-info/METADATA,sha256=pOs4RzpaFcMK7DkbD4k6pzh8BW7aPMUbT4rF1gcSKd4,22878
88
- etlplus-0.12.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
89
- etlplus-0.12.3.dist-info/entry_points.txt,sha256=6w-2-jzuPa55spzK34h-UKh2JTEShh38adFRONNP9QE,45
90
- etlplus-0.12.3.dist-info/top_level.txt,sha256=aWWF-udn_sLGuHTM6W6MLh99ArS9ROkUWO8Mi8y1_2U,8
91
- etlplus-0.12.3.dist-info/RECORD,,
87
+ etlplus-0.12.5.dist-info/licenses/LICENSE,sha256=MuNO63i6kWmgnV2pbP2SLqP54mk1BGmu7CmbtxMmT-U,1069
88
+ etlplus-0.12.5.dist-info/METADATA,sha256=Iz6dewUKxGPdY5QY2FqK82PPcq8IV_2MyM6rzZhfdIA,22878
89
+ etlplus-0.12.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
90
+ etlplus-0.12.5.dist-info/entry_points.txt,sha256=6w-2-jzuPa55spzK34h-UKh2JTEShh38adFRONNP9QE,45
91
+ etlplus-0.12.5.dist-info/top_level.txt,sha256=aWWF-udn_sLGuHTM6W6MLh99ArS9ROkUWO8Mi8y1_2U,8
92
+ etlplus-0.12.5.dist-info/RECORD,,