etlplus 0.7.0__py3-none-any.whl → 0.8.3__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 +870 -0
- etlplus/cli/constants.py +65 -0
- etlplus/cli/handlers.py +300 -417
- etlplus/cli/io.py +320 -0
- etlplus/cli/main.py +14 -417
- etlplus/cli/options.py +49 -0
- etlplus/cli/state.py +335 -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/types.py +5 -0
- etlplus/utils.py +0 -31
- {etlplus-0.7.0.dist-info → etlplus-0.8.3.dist-info}/METADATA +5 -4
- {etlplus-0.7.0.dist-info → etlplus-0.8.3.dist-info}/RECORD +23 -17
- etlplus/cli/app.py +0 -1367
- {etlplus-0.7.0.dist-info → etlplus-0.8.3.dist-info}/WHEEL +0 -0
- {etlplus-0.7.0.dist-info → etlplus-0.8.3.dist-info}/entry_points.txt +0 -0
- {etlplus-0.7.0.dist-info → etlplus-0.8.3.dist-info}/licenses/LICENSE +0 -0
- {etlplus-0.7.0.dist-info → etlplus-0.8.3.dist-info}/top_level.txt +0 -0
etlplus/cli/constants.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
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 --from file in.json '
|
|
46
|
+
'--operations "{"select": ["id"]}" --to file -o out.json'
|
|
47
|
+
),
|
|
48
|
+
' etlplus extract in.csv | etlplus load --to file out.json',
|
|
49
|
+
' cat data.json | etlplus load --to api https://example.com/data',
|
|
50
|
+
'',
|
|
51
|
+
' Override format inference when extensions are misleading:',
|
|
52
|
+
'',
|
|
53
|
+
' etlplus extract data.txt --source-format csv',
|
|
54
|
+
' etlplus load payload.bin --target-format json',
|
|
55
|
+
],
|
|
56
|
+
)
|
|
57
|
+
CLI_EPILOG: Final[str] = '\n'.join(
|
|
58
|
+
[
|
|
59
|
+
'Tip:',
|
|
60
|
+
'--source-format and --target-format override format inference '
|
|
61
|
+
'based on filename extensions when needed.',
|
|
62
|
+
],
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
PROJECT_URL: Final[str] = 'https://github.com/Dagitali/ETLPlus'
|