etlplus 0.11.8__py3-none-any.whl → 0.11.10__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/cli/handlers.py CHANGED
@@ -570,7 +570,7 @@ def transform_handler(
570
570
  data = transform(payload, cast(TransformOperations, operations_payload))
571
571
 
572
572
  if target and target != '-':
573
- File.from_path(target, file_format=target_format).write(data)
573
+ File(target, file_format=target_format).write(data)
574
574
  print(f'Data transformed and saved to {target}')
575
575
  return 0
576
576
 
etlplus/database/ddl.py CHANGED
@@ -203,7 +203,7 @@ def load_table_spec(
203
203
  raise ValueError('Spec must be .json, .yml, or .yaml')
204
204
 
205
205
  try:
206
- spec = File.from_path(spec_path).read()
206
+ spec = File(spec_path).read()
207
207
  except ImportError as e:
208
208
  if suffix in {'.yml', '.yaml'}:
209
209
  raise RuntimeError(
etlplus/file/avro.py ADDED
@@ -0,0 +1,59 @@
1
+ """
2
+ :mod:`etlplus.file.avro` module.
3
+
4
+ Stub helpers for AVRO read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read AVRO content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the AVRO file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+
30
+ Raises
31
+ ------
32
+ NotImplementedError
33
+ AVRO :func:`read` is not implemented yet.
34
+ """
35
+ raise NotImplementedError('AVRO read is not implemented yet')
36
+
37
+
38
+ def write(path: Path, data: JSONData) -> int:
39
+ """
40
+ Write ``data`` to AVRO at ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the AVRO file on disk.
46
+ data : JSONData
47
+ Data to write.
48
+
49
+ Returns
50
+ -------
51
+ int
52
+ Number of records written.
53
+
54
+ Raises
55
+ ------
56
+ NotImplementedError
57
+ AVRO :func:`write` is not implemented yet.
58
+ """
59
+ raise NotImplementedError('AVRO write is not implemented yet')
etlplus/file/core.py CHANGED
@@ -11,11 +11,21 @@ from dataclasses import dataclass
11
11
  from pathlib import Path
12
12
 
13
13
  from ..types import JSONData
14
- from ..types import StrPath
14
+ from . import avro
15
15
  from . import csv
16
+ from . import feather
17
+ from . import gz
16
18
  from . import json
19
+ from . import ndjson
20
+ from . import orc
21
+ from . import parquet
22
+ from . import tsv
23
+ from . import txt
24
+ from . import xls
25
+ from . import xlsx
17
26
  from . import xml
18
27
  from . import yaml
28
+ from . import zip
19
29
  from .enums import FileFormat
20
30
  from .enums import infer_file_format_and_compression
21
31
 
@@ -43,7 +53,15 @@ class File:
43
53
  Path to the file on disk.
44
54
  file_format : FileFormat | None, optional
45
55
  Explicit format. If omitted, the format is inferred from the file
46
- extension (``.csv``, ``.json``, or ``.xml``).
56
+ extension (``.csv``, ``.json``, etc.).
57
+
58
+ Parameters
59
+ ----------
60
+ path : StrPath
61
+ Path to the file on disk.
62
+ file_format : FileFormat | str | None, optional
63
+ Explicit format. If omitted, the format is inferred from the file
64
+ extension (``.csv``, ``.json``, etc.).
47
65
  """
48
66
 
49
67
  # -- Attributes -- #
@@ -62,16 +80,10 @@ class File:
62
80
  extension is unknown, the attribute is left as ``None`` and will be
63
81
  validated later by :meth:`_ensure_format`.
64
82
  """
65
- # Normalize incoming path (allow str in constructor) to Path.
66
- if isinstance(self.path, str):
67
- self.path = Path(self.path)
68
-
83
+ self.path = Path(self.path)
84
+ self.file_format = self._coerce_format(self.file_format)
69
85
  if self.file_format is None:
70
- try:
71
- self.file_format = self._guess_format()
72
- except ValueError:
73
- # Leave as None; _ensure_format() will raise on use if needed.
74
- pass
86
+ self.file_format = self._maybe_guess_format()
75
87
 
76
88
  # -- Internal Instance Methods -- #
77
89
 
@@ -84,6 +96,28 @@ class File:
84
96
  if not self.path.exists():
85
97
  raise FileNotFoundError(f'File not found: {self.path}')
86
98
 
99
+ def _coerce_format(
100
+ self,
101
+ file_format: FileFormat | str | None,
102
+ ) -> FileFormat | None:
103
+ """
104
+ Normalize the file format input.
105
+
106
+ Parameters
107
+ ----------
108
+ file_format : FileFormat | str | None
109
+ File format specifier. Strings are coerced into
110
+ :class:`FileFormat`.
111
+
112
+ Returns
113
+ -------
114
+ FileFormat | None
115
+ A normalized file format, or ``None`` when unspecified.
116
+ """
117
+ if file_format is None or isinstance(file_format, FileFormat):
118
+ return file_format
119
+ return FileFormat.coerce(file_format)
120
+
87
121
  def _ensure_format(self) -> FileFormat:
88
122
  """
89
123
  Resolve the active format, guessing from extension if needed.
@@ -125,6 +159,21 @@ class File:
125
159
  f'Cannot infer file format from extension {self.path.suffix!r}',
126
160
  )
127
161
 
162
+ def _maybe_guess_format(self) -> FileFormat | None:
163
+ """
164
+ Try to infer the format, returning ``None`` if it cannot be inferred.
165
+
166
+ Returns
167
+ -------
168
+ FileFormat | None
169
+ The inferred format, or ``None`` if inference fails.
170
+ """
171
+ try:
172
+ return self._guess_format()
173
+ except ValueError:
174
+ # Leave as None; _ensure_format() will raise on use if needed.
175
+ return None
176
+
128
177
  # -- Instance Methods -- #
129
178
 
130
179
  def read(self) -> JSONData:
@@ -144,14 +193,36 @@ class File:
144
193
  self._assert_exists()
145
194
  fmt = self._ensure_format()
146
195
  match fmt:
196
+ case FileFormat.AVRO:
197
+ return avro.read(self.path)
147
198
  case FileFormat.CSV:
148
199
  return csv.read(self.path)
200
+ case FileFormat.FEATHER:
201
+ return feather.read(self.path)
202
+ case FileFormat.GZ:
203
+ return gz.read(self.path)
149
204
  case FileFormat.JSON:
150
205
  return json.read(self.path)
206
+ case FileFormat.NDJSON:
207
+ return ndjson.read(self.path)
208
+ case FileFormat.ORC:
209
+ return orc.read(self.path)
210
+ case FileFormat.PARQUET:
211
+ return parquet.read(self.path)
212
+ case FileFormat.TSV:
213
+ return tsv.read(self.path)
214
+ case FileFormat.TXT:
215
+ return txt.read(self.path)
216
+ case FileFormat.XLS:
217
+ return xls.read(self.path)
218
+ case FileFormat.XLSX:
219
+ return xlsx.read(self.path)
151
220
  case FileFormat.XML:
152
221
  return xml.read(self.path)
153
222
  case FileFormat.YAML:
154
223
  return yaml.read(self.path)
224
+ case FileFormat.ZIP:
225
+ return zip.read(self.path)
155
226
  raise ValueError(f'Unsupported format: {fmt}')
156
227
 
157
228
  def write(
@@ -183,46 +254,34 @@ class File:
183
254
  """
184
255
  fmt = self._ensure_format()
185
256
  match fmt:
257
+ case FileFormat.AVRO:
258
+ return avro.write(self.path, data)
186
259
  case FileFormat.CSV:
187
260
  return csv.write(self.path, data)
261
+ case FileFormat.FEATHER:
262
+ return feather.write(self.path, data)
263
+ case FileFormat.GZ:
264
+ return gz.write(self.path, data)
188
265
  case FileFormat.JSON:
189
266
  return json.write(self.path, data)
267
+ case FileFormat.NDJSON:
268
+ return ndjson.write(self.path, data)
269
+ case FileFormat.ORC:
270
+ return orc.write(self.path, data)
271
+ case FileFormat.PARQUET:
272
+ return parquet.write(self.path, data)
273
+ case FileFormat.TSV:
274
+ return tsv.write(self.path, data)
275
+ case FileFormat.TXT:
276
+ return txt.write(self.path, data)
277
+ case FileFormat.XLS:
278
+ return xls.write(self.path, data)
279
+ case FileFormat.XLSX:
280
+ return xlsx.write(self.path, data)
190
281
  case FileFormat.XML:
191
282
  return xml.write(self.path, data, root_tag=root_tag)
192
283
  case FileFormat.YAML:
193
284
  return yaml.write(self.path, data)
285
+ case FileFormat.ZIP:
286
+ return zip.write(self.path, data)
194
287
  raise ValueError(f'Unsupported format: {fmt}')
195
-
196
- # -- Class Methods -- #
197
-
198
- @classmethod
199
- def from_path(
200
- cls,
201
- path: StrPath,
202
- *,
203
- file_format: FileFormat | str | None = None,
204
- ) -> File:
205
- """
206
- Create a :class:`File` from any path-like and optional format.
207
-
208
- Parameters
209
- ----------
210
- path : StrPath
211
- Path to the file on disk.
212
- file_format : FileFormat | str | None, optional
213
- Explicit format. If omitted, the format is inferred from the file
214
- extension (``.csv``, ``.json``, or ``.xml``).
215
-
216
- Returns
217
- -------
218
- File
219
- The constructed :class:`File` instance.
220
- """
221
- resolved = Path(path)
222
- ff: FileFormat | None
223
- if isinstance(file_format, str):
224
- ff = FileFormat.coerce(file_format)
225
- else:
226
- ff = file_format
227
-
228
- return cls(resolved, ff)
@@ -0,0 +1,59 @@
1
+ """
2
+ :mod:`etlplus.file.feather` module.
3
+
4
+ Stub helpers for FEATHER read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read FEATHER content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the FEATHER file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+
30
+ Raises
31
+ ------
32
+ NotImplementedError
33
+ FEATHER :func:`read` is not implemented yet.
34
+ """
35
+ raise NotImplementedError('FEATHER read is not implemented yet')
36
+
37
+
38
+ def write(path: Path, data: JSONData) -> int:
39
+ """
40
+ Write ``data`` to FEATHER at ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the FEATHER file on disk.
46
+ data : JSONData
47
+ Data to write.
48
+
49
+ Returns
50
+ -------
51
+ int
52
+ Number of records written.
53
+
54
+ Raises
55
+ ------
56
+ NotImplementedError
57
+ FEATHER :func:`write` is not implemented yet.
58
+ """
59
+ raise NotImplementedError('FEATHER write is not implemented yet')
etlplus/file/gz.py ADDED
@@ -0,0 +1,59 @@
1
+ """
2
+ :mod:`etlplus.file.gz` module.
3
+
4
+ Stub helpers for GZ read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read GZ content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the GZ file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+
30
+ Raises
31
+ ------
32
+ NotImplementedError
33
+ GZ :func:`read` is not implemented yet.
34
+ """
35
+ raise NotImplementedError('GZ read is not implemented yet')
36
+
37
+
38
+ def write(path: Path, data: JSONData) -> int:
39
+ """
40
+ Write ``data`` to GZ at ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the GZ file on disk.
46
+ data : JSONData
47
+ Data to write.
48
+
49
+ Returns
50
+ -------
51
+ int
52
+ Number of records written.
53
+
54
+ Raises
55
+ ------
56
+ NotImplementedError
57
+ GZ :func:`write` is not implemented yet.
58
+ """
59
+ raise NotImplementedError('GZ write is not implemented yet')
etlplus/file/ndjson.py ADDED
@@ -0,0 +1,59 @@
1
+ """
2
+ :mod:`etlplus.file.ndjson` module.
3
+
4
+ Stub helpers for NDJSON read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read NDJSON content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the NDJSON file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+
30
+ Raises
31
+ ------
32
+ NotImplementedError
33
+ NDJSON :func:`read` is not implemented yet.
34
+ """
35
+ raise NotImplementedError('NDJSON read is not implemented yet')
36
+
37
+
38
+ def write(path: Path, data: JSONData) -> int:
39
+ """
40
+ Write ``data`` to NDJSON at ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the NDJSON file on disk.
46
+ data : JSONData
47
+ Data to write.
48
+
49
+ Returns
50
+ -------
51
+ int
52
+ Number of records written.
53
+
54
+ Raises
55
+ ------
56
+ NotImplementedError
57
+ NDJSON :func:`write` is not implemented yet.
58
+ """
59
+ raise NotImplementedError('NDJSON write is not implemented yet')
etlplus/file/orc.py ADDED
@@ -0,0 +1,59 @@
1
+ """
2
+ :mod:`etlplus.file.orc` module.
3
+
4
+ Stub helpers for ORC read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read ORC content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the ORC file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+
30
+ Raises
31
+ ------
32
+ NotImplementedError
33
+ ORC :func:`read` is not implemented yet.
34
+ """
35
+ raise NotImplementedError('ORC read is not implemented yet')
36
+
37
+
38
+ def write(path: Path, data: JSONData) -> int:
39
+ """
40
+ Write ``data`` to ORC at ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the ORC file on disk.
46
+ data : JSONData
47
+ Data to write.
48
+
49
+ Returns
50
+ -------
51
+ int
52
+ Number of records written.
53
+
54
+ Raises
55
+ ------
56
+ NotImplementedError
57
+ ORC :func:`write` is not implemented yet.
58
+ """
59
+ raise NotImplementedError('ORC write is not implemented yet')
@@ -0,0 +1,59 @@
1
+ """
2
+ :mod:`etlplus.file.parquet` module.
3
+
4
+ Stub helpers for PARQUET read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read PARQUET content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the PARQUET file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+
30
+ Raises
31
+ ------
32
+ NotImplementedError
33
+ PARQUET :func:`read` is not implemented yet.
34
+ """
35
+ raise NotImplementedError('PARQUET read is not implemented yet')
36
+
37
+
38
+ def write(path: Path, data: JSONData) -> int:
39
+ """
40
+ Write ``data`` to PARQUET at ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the PARQUET file on disk.
46
+ data : JSONData
47
+ Data to write.
48
+
49
+ Returns
50
+ -------
51
+ int
52
+ Number of records written.
53
+
54
+ Raises
55
+ ------
56
+ NotImplementedError
57
+ PARQUET :func:`write` is not implemented yet.
58
+ """
59
+ raise NotImplementedError('PARQUET write is not implemented yet')
etlplus/file/tsv.py ADDED
@@ -0,0 +1,59 @@
1
+ """
2
+ :mod:`etlplus.file.tsv` module.
3
+
4
+ Stub helpers for TSV read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read TSV content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the TSV file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+
30
+ Raises
31
+ ------
32
+ NotImplementedError
33
+ TSV :func:`read` is not implemented yet.
34
+ """
35
+ raise NotImplementedError('TSV read is not implemented yet')
36
+
37
+
38
+ def write(path: Path, data: JSONData) -> int:
39
+ """
40
+ Write ``data`` to TSV at ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the TSV file on disk.
46
+ data : JSONData
47
+ Data to write.
48
+
49
+ Returns
50
+ -------
51
+ int
52
+ Number of records written.
53
+
54
+ Raises
55
+ ------
56
+ NotImplementedError
57
+ TSV :func:`write` is not implemented yet.
58
+ """
59
+ raise NotImplementedError('TSV write is not implemented yet')
etlplus/file/txt.py ADDED
@@ -0,0 +1,59 @@
1
+ """
2
+ :mod:`etlplus.file.txt` module.
3
+
4
+ Stub helpers for TXT read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read TXT content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the TXT file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+
30
+ Raises
31
+ ------
32
+ NotImplementedError
33
+ TXT :func:`read` is not implemented yet.
34
+ """
35
+ raise NotImplementedError('TXT read is not implemented yet')
36
+
37
+
38
+ def write(path: Path, data: JSONData) -> int:
39
+ """
40
+ Write ``data`` to TXT at ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the TXT file on disk.
46
+ data : JSONData
47
+ Data to write.
48
+
49
+ Returns
50
+ -------
51
+ int
52
+ Number of records written.
53
+
54
+ Raises
55
+ ------
56
+ NotImplementedError
57
+ TXT :func:`write` is not implemented yet.
58
+ """
59
+ raise NotImplementedError('TXT write is not implemented yet')
etlplus/file/xls.py ADDED
@@ -0,0 +1,59 @@
1
+ """
2
+ :mod:`etlplus.file.xls` module.
3
+
4
+ Stub helpers for XLS read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read XLS content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the XLS file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+
30
+ Raises
31
+ ------
32
+ NotImplementedError
33
+ XLS :func:`read` is not implemented yet.
34
+ """
35
+ raise NotImplementedError('XLS read is not implemented yet')
36
+
37
+
38
+ def write(path: Path, data: JSONData) -> int:
39
+ """
40
+ Write ``data`` to XLS at ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the XLS file on disk.
46
+ data : JSONData
47
+ Data to write.
48
+
49
+ Returns
50
+ -------
51
+ int
52
+ Number of records written.
53
+
54
+ Raises
55
+ ------
56
+ NotImplementedError
57
+ XLS :func:`write` is not implemented yet.
58
+ """
59
+ raise NotImplementedError('XLS write is not implemented yet')
etlplus/file/xlsx.py ADDED
@@ -0,0 +1,59 @@
1
+ """
2
+ :mod:`etlplus.file.xlsx` module.
3
+
4
+ Stub helpers for XLSX read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read XLSX content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the XLSX file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+
30
+ Raises
31
+ ------
32
+ NotImplementedError
33
+ XLSX :func:`read` is not implemented yet.
34
+ """
35
+ raise NotImplementedError('XLSX read is not implemented yet')
36
+
37
+
38
+ def write(path: Path, data: JSONData) -> int:
39
+ """
40
+ Write ``data`` to XLSX at ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the XLSX file on disk.
46
+ data : JSONData
47
+ Data to write.
48
+
49
+ Returns
50
+ -------
51
+ int
52
+ Number of records written.
53
+
54
+ Raises
55
+ ------
56
+ NotImplementedError
57
+ XLSX :func:`write` is not implemented yet.
58
+ """
59
+ raise NotImplementedError('XLSX write is not implemented yet')
etlplus/file/zip.py ADDED
@@ -0,0 +1,49 @@
1
+ """
2
+ :mod:`etlplus.file.zip` module.
3
+
4
+ Stub helpers for ZIP read/write.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+
11
+ from ..types import JSONData
12
+
13
+ # SECTION: EXPORTS ========================================================== #
14
+
15
+
16
+ def read(path: Path) -> JSONData:
17
+ """
18
+ Read ZIP content from ``path``.
19
+
20
+ Parameters
21
+ ----------
22
+ path : Path
23
+ Path to the ZIP file on disk.
24
+
25
+ Returns
26
+ -------
27
+ JSONData
28
+ Parsed payload.
29
+ """
30
+ raise NotImplementedError('ZIP read is not implemented yet')
31
+
32
+
33
+ def write(path: Path, data: JSONData) -> int:
34
+ """
35
+ Write ``data`` to ZIP at ``path``.
36
+
37
+ Parameters
38
+ ----------
39
+ path : Path
40
+ Path to the ZIP file on disk.
41
+ data : JSONData
42
+ Data to write.
43
+
44
+ Returns
45
+ -------
46
+ int
47
+ Number of records written.
48
+ """
49
+ raise NotImplementedError('ZIP write is not implemented yet')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: etlplus
3
- Version: 0.11.8
3
+ Version: 0.11.10
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
@@ -32,7 +32,7 @@ etlplus/api/rate_limiting/rate_limiter.py,sha256=Uxozqd_Ej5Lsj-M-mLT2WexChgWh7x3
32
32
  etlplus/cli/__init__.py,sha256=J97-Rv931IL1_b4AXnB7Fbbd7HKnHBpx18NQfC_kE6c,299
33
33
  etlplus/cli/commands.py,sha256=g8_m3A8HEMyTRu2HctNiRoi2gtB5oSZCUEcyq-PIXos,24669
34
34
  etlplus/cli/constants.py,sha256=E6Uy4WauLa_0zkzxqImXh-bb1gKdb9sBZQVc8QOzr2Q,1943
35
- etlplus/cli/handlers.py,sha256=Gf0lq5j5e5RK2SsIqTGjC9lqEKvJJ13lZk3yUD8gupc,17764
35
+ etlplus/cli/handlers.py,sha256=FvnYWKRg4u7iCcIvAJtpjDEbqw2DHj3G34NXJbMwnHk,17754
36
36
  etlplus/cli/io.py,sha256=EFaBPYaBOyOllfMQWXgTjy-MPiGfNejicpD7ROrPyAE,7840
37
37
  etlplus/cli/main.py,sha256=IgeqxypixfwLHR-QcpgVMQ7vMZ865bXOh2oO9v-BWeM,5234
38
38
  etlplus/cli/options.py,sha256=vfXT3YLh7wG1iC-aTdSg6ItMC8l6n0Lozmy53XjqLbA,1199
@@ -46,26 +46,37 @@ etlplus/config/profile.py,sha256=Ss2zedQGjkaGSpvBLTD4SZaWViMJ7TJPLB8Q2_BTpPg,189
46
46
  etlplus/config/types.py,sha256=a0epJ3z16HQ5bY3Ctf8s_cQPa3f0HHcwdOcjCP2xoG4,4954
47
47
  etlplus/config/utils.py,sha256=4SUHMkt5bKBhMhiJm-DrnmE2Q4TfOgdNCKz8PJDS27o,3443
48
48
  etlplus/database/__init__.py,sha256=AKJsDl2RHuRGPS-eXgNJeh4aSncJP5Y0yLApBF6i7i8,1052
49
- etlplus/database/ddl.py,sha256=CKrxGWGKkick--AnUUzBRGpH30f4h8RuE3JXOLg420o,7923
49
+ etlplus/database/ddl.py,sha256=0dEM9SJMMabkhI_h-Fc0j9a1Sl5lSyZdI0bIeBVGm10,7913
50
50
  etlplus/database/engine.py,sha256=PUxXLvLPyc-KaxuW7fXe12wYci7EvUp-Ad1H3bGhUog,4058
51
51
  etlplus/database/orm.py,sha256=gCSqH-CjQz6tV9133-VqgiwokK5ylun0BwXaIWfImAo,10008
52
52
  etlplus/database/schema.py,sha256=813C0Dd3WE53KTYot4dgjAxctgKXLXx-8_Rk_4r2e28,7022
53
53
  etlplus/database/types.py,sha256=_pkQyC14TzAlgyeIqZG4F5LWYknZbHw3TW68Auk7Ya0,795
54
54
  etlplus/file/__init__.py,sha256=X03bosSM-uSd6dh3ur0un6_ozFRw2Tm4PE6kVUjtXK8,475
55
- etlplus/file/core.py,sha256=oQsqoFp3PEt1cgHyNeK36gim45RFPV6lZ3R4hvFm5Nw,6447
55
+ etlplus/file/avro.py,sha256=My9VCUSVmHrGVCr6AAWJmnjyXOzdYUGraL_Mvyvs3x4,1115
56
+ etlplus/file/core.py,sha256=_8AgtXlw1SuderxA43C-SPjudvnzknlUdpAQynTPu28,8682
56
57
  etlplus/file/csv.py,sha256=VbMW_NaqCw03HlfvYzb9MoAgCXI3cl9qc4dASkTHoyw,1880
57
58
  etlplus/file/enums.py,sha256=rwrbwj6PejG0c5v6jzcsmeNu9cSqDyWB1foIuM5UyJo,6648
59
+ etlplus/file/feather.py,sha256=2YApt6tOFwyaNwekJ2kWFkmVzyyUPN_2TwE8_jf4ZCI,1145
60
+ etlplus/file/gz.py,sha256=UaWzELOUHi8wuaK37ZbcsXqtV7ySfkiViKLqC5xqFpM,1095
58
61
  etlplus/file/json.py,sha256=xSV5PkZ_tZQuZNdLr1FQUwuCQXyL7Ch3WRJ3hkw0p68,1911
62
+ etlplus/file/ndjson.py,sha256=XnqFngwjlekfuZiG-rjU0iJflStdCIFbRIS-HVbgmjs,1135
63
+ etlplus/file/orc.py,sha256=fzXmHbfLibEypoltwU0a5t-Q6upQOc92b8tO_ftq0Kw,1105
64
+ etlplus/file/parquet.py,sha256=gYTd1XSlizWDhZINTOJAt8z1XhVOiV3K86_a82nFs8w,1145
65
+ etlplus/file/tsv.py,sha256=6VYowab5qNKNemuFPJbUzEgVz_pRrisSJCPWpQzMc4w,1105
66
+ etlplus/file/txt.py,sha256=dkAHhZYi_fEcAm7irPKpg4l-ayXBrl7J1MWEigWvwRQ,1105
67
+ etlplus/file/xls.py,sha256=56qP0Ug8IYeO1wvyL0nHI54BZa7IG8Nm7BB070wyEn0,1105
68
+ etlplus/file/xlsx.py,sha256=SG4ILdxGXNdnwOakq4ExEDE6loWWrSEXFk47AZmwYzw,1115
59
69
  etlplus/file/xml.py,sha256=vjate5u9Z26LPlpvZsdzpqXsIUZRgen7oHa3ly-aIhs,3905
60
70
  etlplus/file/yaml.py,sha256=6KaWoG7oYB26EHX2TZ7LOgigO11Hoq3MH--adFq_Eck,3004
71
+ etlplus/file/zip.py,sha256=IF6OznDqDHZNX1HmVUW3qHvNsy_7wRKGQ_iTHIBGG1U,912
61
72
  etlplus/templates/__init__.py,sha256=tsniN7XJYs3NwYxJ6c2HD5upHP3CDkLx-bQCMt97UOM,106
62
73
  etlplus/templates/ddl.sql.j2,sha256=s8fMWvcb4eaJVXkifuib1aQPljtZ8buuyB_uA-ZdU3Q,4734
63
74
  etlplus/templates/view.sql.j2,sha256=Iy8DHfhq5yyvrUKDxqp_aHIEXY4Tm6j4wT7YDEFWAhk,2180
64
75
  etlplus/validation/__init__.py,sha256=Pe5Xg1_EA4uiNZGYu5WTF3j7odjmyxnAJ8rcioaplSQ,1254
65
76
  etlplus/validation/utils.py,sha256=Mtqg449VIke0ziy_wd2r6yrwJzQkA1iulZC87FzXMjo,10201
66
- etlplus-0.11.8.dist-info/licenses/LICENSE,sha256=MuNO63i6kWmgnV2pbP2SLqP54mk1BGmu7CmbtxMmT-U,1069
67
- etlplus-0.11.8.dist-info/METADATA,sha256=j8BQpzSkBMHdll616-fmDCxV4izMcnCsl686nFAHttM,21036
68
- etlplus-0.11.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
69
- etlplus-0.11.8.dist-info/entry_points.txt,sha256=6w-2-jzuPa55spzK34h-UKh2JTEShh38adFRONNP9QE,45
70
- etlplus-0.11.8.dist-info/top_level.txt,sha256=aWWF-udn_sLGuHTM6W6MLh99ArS9ROkUWO8Mi8y1_2U,8
71
- etlplus-0.11.8.dist-info/RECORD,,
77
+ etlplus-0.11.10.dist-info/licenses/LICENSE,sha256=MuNO63i6kWmgnV2pbP2SLqP54mk1BGmu7CmbtxMmT-U,1069
78
+ etlplus-0.11.10.dist-info/METADATA,sha256=3rdmx9-liLMQTnoE4GbE7VRmKxvv46I8IDhl9jCyL70,21037
79
+ etlplus-0.11.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
80
+ etlplus-0.11.10.dist-info/entry_points.txt,sha256=6w-2-jzuPa55spzK34h-UKh2JTEShh38adFRONNP9QE,45
81
+ etlplus-0.11.10.dist-info/top_level.txt,sha256=aWWF-udn_sLGuHTM6W6MLh99ArS9ROkUWO8Mi8y1_2U,8
82
+ etlplus-0.11.10.dist-info/RECORD,,