etlplus 0.7.0__py3-none-any.whl → 0.9.0__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/api/README.md +24 -26
- etlplus/cli/commands.py +924 -0
- etlplus/cli/constants.py +71 -0
- etlplus/cli/handlers.py +302 -420
- etlplus/cli/io.py +336 -0
- etlplus/cli/main.py +16 -418
- etlplus/cli/options.py +49 -0
- etlplus/cli/state.py +336 -0
- etlplus/cli/types.py +33 -0
- etlplus/database/__init__.py +2 -0
- etlplus/database/ddl.py +37 -29
- etlplus/database/engine.py +10 -5
- etlplus/database/orm.py +18 -11
- etlplus/database/schema.py +3 -2
- etlplus/database/types.py +33 -0
- etlplus/load.py +1 -1
- etlplus/types.py +5 -0
- etlplus/utils.py +1 -32
- {etlplus-0.7.0.dist-info → etlplus-0.9.0.dist-info}/METADATA +65 -32
- {etlplus-0.7.0.dist-info → etlplus-0.9.0.dist-info}/RECORD +24 -18
- etlplus/cli/app.py +0 -1367
- {etlplus-0.7.0.dist-info → etlplus-0.9.0.dist-info}/WHEEL +0 -0
- {etlplus-0.7.0.dist-info → etlplus-0.9.0.dist-info}/entry_points.txt +0 -0
- {etlplus-0.7.0.dist-info → etlplus-0.9.0.dist-info}/licenses/LICENSE +0 -0
- {etlplus-0.7.0.dist-info → etlplus-0.9.0.dist-info}/top_level.txt +0 -0
etlplus/cli/constants.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""
|
|
2
|
+
:mod:`etlplus.cli.constants` module.
|
|
3
|
+
|
|
4
|
+
Shared constants for :mod:`etlplus.cli`.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import Final
|
|
10
|
+
|
|
11
|
+
from ..enums import DataConnectorType
|
|
12
|
+
from ..enums import FileFormat
|
|
13
|
+
|
|
14
|
+
# SECTION: EXPORTS ========================================================== #
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
# Constants
|
|
19
|
+
'CLI_DESCRIPTION',
|
|
20
|
+
'CLI_EPILOG',
|
|
21
|
+
'DATA_CONNECTORS',
|
|
22
|
+
'DEFAULT_FILE_FORMAT',
|
|
23
|
+
'FILE_FORMATS',
|
|
24
|
+
'PROJECT_URL',
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# SECTION: CONSTANTS ======================================================== #
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
DATA_CONNECTORS: Final[frozenset[str]] = frozenset(DataConnectorType.choices())
|
|
32
|
+
|
|
33
|
+
FILE_FORMATS: Final[frozenset[str]] = frozenset(FileFormat.choices())
|
|
34
|
+
DEFAULT_FILE_FORMAT: Final[str] = 'json'
|
|
35
|
+
|
|
36
|
+
CLI_DESCRIPTION: Final[str] = '\n'.join(
|
|
37
|
+
[
|
|
38
|
+
'ETLPlus - A Swiss Army knife for simple ETL operations.',
|
|
39
|
+
'',
|
|
40
|
+
'Provide a subcommand and options. Examples:',
|
|
41
|
+
'',
|
|
42
|
+
' etlplus extract in.csv > out.json',
|
|
43
|
+
' etlplus validate in.json --rules "{"required": ["id"]}"',
|
|
44
|
+
(
|
|
45
|
+
' etlplus transform in.json --source-type file out.json '
|
|
46
|
+
'--target-type file --operations "{"select": ["id"]}"'
|
|
47
|
+
),
|
|
48
|
+
(
|
|
49
|
+
' etlplus extract in.csv | '
|
|
50
|
+
'etlplus load out.json --target-type file'
|
|
51
|
+
),
|
|
52
|
+
(
|
|
53
|
+
' cat data.json | '
|
|
54
|
+
'etlplus load https://example.com/data --target-type api'
|
|
55
|
+
),
|
|
56
|
+
'',
|
|
57
|
+
'Override format inference when extensions are misleading:',
|
|
58
|
+
'',
|
|
59
|
+
' etlplus extract data.txt --source-format csv',
|
|
60
|
+
' etlplus load payload.bin --target-format json',
|
|
61
|
+
],
|
|
62
|
+
)
|
|
63
|
+
CLI_EPILOG: Final[str] = '\n'.join(
|
|
64
|
+
[
|
|
65
|
+
'Tip:',
|
|
66
|
+
'`--source-format` and `--target-format` override format inference '
|
|
67
|
+
'based on filename extensions when needed.',
|
|
68
|
+
],
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
PROJECT_URL: Final[str] = 'https://github.com/Dagitali/ETLPlus'
|