etlplus 0.11.9__tar.gz → 0.11.11__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.
- {etlplus-0.11.9/etlplus.egg-info → etlplus-0.11.11}/PKG-INFO +1 -1
- etlplus-0.11.11/etlplus/file/avro.py +59 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/file/core.py +55 -0
- etlplus-0.11.11/etlplus/file/feather.py +59 -0
- etlplus-0.11.11/etlplus/file/gz.py +59 -0
- etlplus-0.11.11/etlplus/file/ndjson.py +59 -0
- etlplus-0.11.11/etlplus/file/orc.py +59 -0
- etlplus-0.11.11/etlplus/file/parquet.py +59 -0
- etlplus-0.11.11/etlplus/file/tsv.py +59 -0
- etlplus-0.11.11/etlplus/file/txt.py +59 -0
- etlplus-0.11.11/etlplus/file/xls.py +59 -0
- etlplus-0.11.11/etlplus/file/xlsx.py +59 -0
- etlplus-0.11.11/etlplus/file/zip.py +49 -0
- {etlplus-0.11.9 → etlplus-0.11.11/etlplus.egg-info}/PKG-INFO +1 -1
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus.egg-info/SOURCES.txt +11 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/file/test_u_file_core.py +57 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/.coveragerc +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/.editorconfig +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/.gitattributes +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/.github/actions/python-bootstrap/action.yml +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/.github/workflows/ci.yml +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/.gitignore +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/.pre-commit-config.yaml +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/.ruff.toml +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/CODE_OF_CONDUCT.md +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/CONTRIBUTING.md +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/DEMO.md +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/LICENSE +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/MANIFEST.in +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/Makefile +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/README.md +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/REFERENCES.md +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/docs/README.md +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/docs/pipeline-guide.md +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/docs/snippets/installation_version.md +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/__main__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/__version__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/README.md +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/auth.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/config.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/endpoint_client.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/errors.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/pagination/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/pagination/client.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/pagination/config.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/pagination/paginator.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/rate_limiting/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/rate_limiting/config.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/rate_limiting/rate_limiter.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/request_manager.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/retry_manager.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/transport.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/api/types.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/cli/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/cli/commands.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/cli/constants.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/cli/handlers.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/cli/io.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/cli/main.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/cli/options.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/cli/state.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/cli/types.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/config/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/config/connector.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/config/jobs.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/config/pipeline.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/config/profile.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/config/types.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/config/utils.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/database/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/database/ddl.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/database/engine.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/database/orm.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/database/schema.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/database/types.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/enums.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/extract.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/file/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/file/csv.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/file/enums.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/file/json.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/file/xml.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/file/yaml.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/load.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/mixins.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/py.typed +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/run.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/run_helpers.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/templates/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/templates/ddl.sql.j2 +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/templates/view.sql.j2 +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/transform.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/types.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/utils.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/validate.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/validation/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus/validation/utils.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus.egg-info/dependency_links.txt +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus.egg-info/entry_points.txt +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus.egg-info/requires.txt +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/etlplus.egg-info/top_level.txt +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/examples/README.md +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/examples/configs/ddl_spec.yml +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/examples/configs/pipeline.yml +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/examples/data/sample.csv +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/examples/data/sample.json +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/examples/data/sample.xml +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/examples/data/sample.xsd +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/examples/data/sample.yaml +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/examples/quickstart_python.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/pyproject.toml +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/pytest.ini +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/setup.cfg +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/setup.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/__init__.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/conftest.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/integration/conftest.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/integration/test_i_cli.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/integration/test_i_examples_data_parity.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/integration/test_i_pagination_strategy.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/integration/test_i_pipeline_smoke.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/integration/test_i_pipeline_yaml_load.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/integration/test_i_run.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/integration/test_i_run_profile_pagination_defaults.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/integration/test_i_run_profile_rate_limit_defaults.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/conftest.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_auth.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_config.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_endpoint_client.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_mocks.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_pagination_client.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_pagination_config.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_paginator.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_rate_limit_config.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_rate_limiter.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_request_manager.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_retry_manager.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_transport.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/api/test_u_types.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/cli/conftest.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/cli/test_u_cli_handlers.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/cli/test_u_cli_io.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/cli/test_u_cli_main.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/cli/test_u_cli_state.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/config/test_u_config_utils.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/config/test_u_connector.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/config/test_u_jobs.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/config/test_u_pipeline.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/conftest.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/database/test_u_database_ddl.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/database/test_u_database_engine.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/database/test_u_database_orm.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/database/test_u_database_schema.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/file/test_u_file_enums.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/file/test_u_file_yaml.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_enums.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_extract.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_load.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_main.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_mixins.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_run.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_run_helpers.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_transform.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_utils.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_validate.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/test_u_version.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tests/unit/validation/test_u_validation_utils.py +0 -0
- {etlplus-0.11.9 → etlplus-0.11.11}/tools/update_demo_snippets.py +0 -0
|
@@ -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')
|
|
@@ -11,10 +11,21 @@ from dataclasses import dataclass
|
|
|
11
11
|
from pathlib import Path
|
|
12
12
|
|
|
13
13
|
from ..types import JSONData
|
|
14
|
+
from . import avro
|
|
14
15
|
from . import csv
|
|
16
|
+
from . import feather
|
|
17
|
+
from . import gz
|
|
15
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
|
|
16
26
|
from . import xml
|
|
17
27
|
from . import yaml
|
|
28
|
+
from . import zip
|
|
18
29
|
from .enums import FileFormat
|
|
19
30
|
from .enums import infer_file_format_and_compression
|
|
20
31
|
|
|
@@ -182,14 +193,36 @@ class File:
|
|
|
182
193
|
self._assert_exists()
|
|
183
194
|
fmt = self._ensure_format()
|
|
184
195
|
match fmt:
|
|
196
|
+
case FileFormat.AVRO:
|
|
197
|
+
return avro.read(self.path)
|
|
185
198
|
case FileFormat.CSV:
|
|
186
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)
|
|
187
204
|
case FileFormat.JSON:
|
|
188
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)
|
|
189
220
|
case FileFormat.XML:
|
|
190
221
|
return xml.read(self.path)
|
|
191
222
|
case FileFormat.YAML:
|
|
192
223
|
return yaml.read(self.path)
|
|
224
|
+
case FileFormat.ZIP:
|
|
225
|
+
return zip.read(self.path)
|
|
193
226
|
raise ValueError(f'Unsupported format: {fmt}')
|
|
194
227
|
|
|
195
228
|
def write(
|
|
@@ -221,12 +254,34 @@ class File:
|
|
|
221
254
|
"""
|
|
222
255
|
fmt = self._ensure_format()
|
|
223
256
|
match fmt:
|
|
257
|
+
case FileFormat.AVRO:
|
|
258
|
+
return avro.write(self.path, data)
|
|
224
259
|
case FileFormat.CSV:
|
|
225
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)
|
|
226
265
|
case FileFormat.JSON:
|
|
227
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)
|
|
228
281
|
case FileFormat.XML:
|
|
229
282
|
return xml.write(self.path, data, root_tag=root_tag)
|
|
230
283
|
case FileFormat.YAML:
|
|
231
284
|
return yaml.write(self.path, data)
|
|
285
|
+
case FileFormat.ZIP:
|
|
286
|
+
return zip.write(self.path, data)
|
|
232
287
|
raise ValueError(f'Unsupported format: {fmt}')
|
|
@@ -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')
|
|
@@ -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')
|
|
@@ -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')
|
|
@@ -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')
|
|
@@ -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')
|
|
@@ -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')
|
|
@@ -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')
|
|
@@ -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')
|