etlx-wrapper 0.1.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 realdatadriven
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.4
2
+ Name: etlx-wrapper
3
+ Version: 0.1.0
4
+ Summary: Python wrapper for ETLX CLI to run ETL workflows from Python
5
+ Author-email: realdatadriven <real.datadriven@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 realdatadriven
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/realdatadriven/etlx
29
+ Project-URL: Repository, https://github.com/realdatadriven/etlx
30
+ Keywords: ETL,duckdb,cli,data-pipeline,wrapper
31
+ Requires-Python: >=3.7
32
+ Description-Content-Type: text/markdown
33
+ License-File: LICENSE
34
+ Dynamic: license-file
35
+
36
+ # ETLX Python Wrapper
37
+
38
+ **ETLX** is a modern and highly configurable ETL and reporting tool powered by DuckDB.
39
+ This Python package provides a simple interface to run ETLX workflows directly from Python.
40
+
41
+ ---
42
+
43
+ ## 📦 Installation
44
+
45
+ Install the wrapper from PyPI:
46
+
47
+ ```bash
48
+ pip install etlx
49
+ ```
50
+
51
+ ### 🧩 Requirements
52
+
53
+ You also need the ETLX binary:
54
+
55
+ 1. Download the latest binary for your platform from
56
+ [ETLX Releases](https://github.com/realdatadriven/etlx/releases)
57
+ 2. Place it in your system `PATH`, or provide the binary path manually when using the wrapper.
58
+
59
+ ---
60
+
61
+ ## 🚀 Quick Start
62
+
63
+ ```python
64
+ from etlx import ETLX
65
+ import datetime
66
+
67
+ _etxl = ETLX()\
68
+ .config = "/path/to/config.md"\
69
+ .only = "keyX"\
70
+ .date = datetime.date.today()\
71
+ .file = "data.csv"\
72
+ .execute()
73
+ ```
74
+
75
+ You can also pass the path to the ETLX binary if it's not in `PATH`:
76
+
77
+ ```python
78
+ runner = ETLX(config="config.md", bin="/path/to/etlx-linux-amd64")
79
+ ```
80
+
81
+ ---
82
+
83
+ ## 🔧 Features
84
+
85
+ - Runs full ETLX workflows from Python
86
+ - Supports `.env` configuration
87
+ - Automatically formats Python `date` objects
88
+ - Compatible with advanced CLI options: `--only`, `--skip`, `--steps`, `--clean`, `--drop`, etc.
89
+
90
+ ---
91
+
92
+ ## 🧱 Learn More
93
+
94
+ Visit the [main project](https://github.com/realdatadriven/etlx) for full documentation, use cases, and advanced config examples.
95
+
96
+ ---
97
+
98
+ ## 🪪 License
99
+
100
+ MIT
@@ -0,0 +1,65 @@
1
+ # ETLX Python Wrapper
2
+
3
+ **ETLX** is a modern and highly configurable ETL and reporting tool powered by DuckDB.
4
+ This Python package provides a simple interface to run ETLX workflows directly from Python.
5
+
6
+ ---
7
+
8
+ ## 📦 Installation
9
+
10
+ Install the wrapper from PyPI:
11
+
12
+ ```bash
13
+ pip install etlx
14
+ ```
15
+
16
+ ### 🧩 Requirements
17
+
18
+ You also need the ETLX binary:
19
+
20
+ 1. Download the latest binary for your platform from
21
+ [ETLX Releases](https://github.com/realdatadriven/etlx/releases)
22
+ 2. Place it in your system `PATH`, or provide the binary path manually when using the wrapper.
23
+
24
+ ---
25
+
26
+ ## 🚀 Quick Start
27
+
28
+ ```python
29
+ from etlx import ETLX
30
+ import datetime
31
+
32
+ _etxl = ETLX()\
33
+ .config = "/path/to/config.md"\
34
+ .only = "keyX"\
35
+ .date = datetime.date.today()\
36
+ .file = "data.csv"\
37
+ .execute()
38
+ ```
39
+
40
+ You can also pass the path to the ETLX binary if it's not in `PATH`:
41
+
42
+ ```python
43
+ runner = ETLX(config="config.md", bin="/path/to/etlx-linux-amd64")
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 🔧 Features
49
+
50
+ - Runs full ETLX workflows from Python
51
+ - Supports `.env` configuration
52
+ - Automatically formats Python `date` objects
53
+ - Compatible with advanced CLI options: `--only`, `--skip`, `--steps`, `--clean`, `--drop`, etc.
54
+
55
+ ---
56
+
57
+ ## 🧱 Learn More
58
+
59
+ Visit the [main project](https://github.com/realdatadriven/etlx) for full documentation, use cases, and advanced config examples.
60
+
61
+ ---
62
+
63
+ ## 🪪 License
64
+
65
+ MIT
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.4
2
+ Name: etlx-wrapper
3
+ Version: 0.1.0
4
+ Summary: Python wrapper for ETLX CLI to run ETL workflows from Python
5
+ Author-email: realdatadriven <real.datadriven@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 realdatadriven
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/realdatadriven/etlx
29
+ Project-URL: Repository, https://github.com/realdatadriven/etlx
30
+ Keywords: ETL,duckdb,cli,data-pipeline,wrapper
31
+ Requires-Python: >=3.7
32
+ Description-Content-Type: text/markdown
33
+ License-File: LICENSE
34
+ Dynamic: license-file
35
+
36
+ # ETLX Python Wrapper
37
+
38
+ **ETLX** is a modern and highly configurable ETL and reporting tool powered by DuckDB.
39
+ This Python package provides a simple interface to run ETLX workflows directly from Python.
40
+
41
+ ---
42
+
43
+ ## 📦 Installation
44
+
45
+ Install the wrapper from PyPI:
46
+
47
+ ```bash
48
+ pip install etlx
49
+ ```
50
+
51
+ ### 🧩 Requirements
52
+
53
+ You also need the ETLX binary:
54
+
55
+ 1. Download the latest binary for your platform from
56
+ [ETLX Releases](https://github.com/realdatadriven/etlx/releases)
57
+ 2. Place it in your system `PATH`, or provide the binary path manually when using the wrapper.
58
+
59
+ ---
60
+
61
+ ## 🚀 Quick Start
62
+
63
+ ```python
64
+ from etlx import ETLX
65
+ import datetime
66
+
67
+ _etxl = ETLX()\
68
+ .config = "/path/to/config.md"\
69
+ .only = "keyX"\
70
+ .date = datetime.date.today()\
71
+ .file = "data.csv"\
72
+ .execute()
73
+ ```
74
+
75
+ You can also pass the path to the ETLX binary if it's not in `PATH`:
76
+
77
+ ```python
78
+ runner = ETLX(config="config.md", bin="/path/to/etlx-linux-amd64")
79
+ ```
80
+
81
+ ---
82
+
83
+ ## 🔧 Features
84
+
85
+ - Runs full ETLX workflows from Python
86
+ - Supports `.env` configuration
87
+ - Automatically formats Python `date` objects
88
+ - Compatible with advanced CLI options: `--only`, `--skip`, `--steps`, `--clean`, `--drop`, etc.
89
+
90
+ ---
91
+
92
+ ## 🧱 Learn More
93
+
94
+ Visit the [main project](https://github.com/realdatadriven/etlx) for full documentation, use cases, and advanced config examples.
95
+
96
+ ---
97
+
98
+ ## 🪪 License
99
+
100
+ MIT
@@ -0,0 +1,8 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ etlx_wrapper.egg-info/PKG-INFO
5
+ etlx_wrapper.egg-info/SOURCES.txt
6
+ etlx_wrapper.egg-info/dependency_links.txt
7
+ etlx_wrapper.egg-info/top_level.txt
8
+ src/__init__.py
@@ -0,0 +1,23 @@
1
+ [project]
2
+ name = "etlx-wrapper"
3
+ version = "0.1.0"
4
+ description = "Python wrapper for ETLX CLI to run ETL workflows from Python"
5
+ authors = [
6
+ { name="realdatadriven", email="real.datadriven@gmail.com" }
7
+ ]
8
+ license = { file = "LICENSE" }
9
+ readme = "README.md"
10
+ requires-python = ">=3.7"
11
+ keywords = ["ETL", "duckdb", "cli", "data-pipeline", "wrapper"]
12
+
13
+ [project.urls]
14
+ Homepage = "https://github.com/realdatadriven/etlx"
15
+ Repository = "https://github.com/realdatadriven/etlx"
16
+
17
+ [build-system]
18
+ requires = ["setuptools>=61"]
19
+ build-backend = "setuptools.build_meta"
20
+
21
+ [tool.setuptools]
22
+ packages = ["src"]
23
+ include-package-data = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,69 @@
1
+ '''**ETLX** is a modern and highly configurable ETL and reporting tool powered by DuckDB.
2
+ This Python package provides a simple interface to run ETLX workflows directly from Python.'''
3
+ import os
4
+ import subprocess
5
+ from pathlib import Path
6
+ from datetime import date, datetime
7
+ from typing import Optional, Union, List
8
+
9
+ class ETLX:
10
+ '''main class'''
11
+ def __init__(
12
+ self,
13
+ bin: str = "etlx",
14
+ config: str = "config.md",
15
+ date_ref: Union[str, date, datetime] = None,
16
+ only: Optional[Union[str, List[str]]] = None,
17
+ skip: Optional[Union[str, List[str]]] = None,
18
+ steps: Optional[str] = None,
19
+ file: Optional[str] = None,
20
+ clean: bool = False,
21
+ drop: bool = False,
22
+ rows: bool = False,
23
+ cwd: Union[str, Path] = ".",
24
+ ):
25
+ self.bin = bin
26
+ self.config = config
27
+ self.date_ref = self._format_date(date_ref)
28
+ self.only = only
29
+ self.skip = skip
30
+ self.steps = steps
31
+ self.file = file
32
+ self.clean = clean
33
+ self.drop = drop
34
+ self.rows = rows
35
+ self.cwd = Path(cwd)
36
+
37
+ def _format_date(self, dt):
38
+ if dt is None:
39
+ return datetime.now().strftime("%Y-%m-%d")
40
+ if isinstance(dt, (datetime, date)):
41
+ return dt.strftime("%Y-%m-%d")
42
+ return str(dt)
43
+
44
+ def _to_flag(self, key: str, value: Optional[Union[str, bool, List[str]]]) -> List[str]:
45
+ if value is None or value is False:
46
+ return []
47
+ if isinstance(value, list):
48
+ value = ",".join(value)
49
+ if isinstance(value, bool):
50
+ return [f"-{key}"]
51
+ return [f"-{key}", str(value)]
52
+
53
+ def execute(self) -> int:
54
+ '''Execute ETLX'''
55
+ args = [
56
+ self.bin,
57
+ *self._to_flag("config", self.config),
58
+ *self._to_flag("date", self.date_ref),
59
+ *self._to_flag("only", self.only),
60
+ *self._to_flag("skip", self.skip),
61
+ *self._to_flag("steps", self.steps),
62
+ *self._to_flag("file", self.file),
63
+ *self._to_flag("clean", self.clean),
64
+ *self._to_flag("drop", self.drop),
65
+ *self._to_flag("rows", self.rows),
66
+ ]
67
+ print(f"[ETLX] Executing: {' '.join(args)} in {self.cwd.resolve()}")
68
+ result = subprocess.run(args, cwd = self.cwd, check = False) #, env=env)
69
+ return result.returncode