SQLPipe - Easy way to build SQL pipelines
With SQLPipe it is possible to create a full pipeline and orchestrate dependencies in a simplified way using SQL. The task management uses the asyncio library, so execution is done with the python coroutine system for parallel executions.
Installation:
pip install sqlpipe
Basic Example
Using SqlPipeBuilder. Once the object has been instantiated, use the add_task method to add the scripts to be executed, you must specify a different id for each task, if one task depends on another, use the parent_id parameter to configure the dependency.
from sqlpipe import SqlPipeBuilder
con_str = 'postgres://user:pass@host:port/dbname'
pipe = SqlPipeBuilder(con_str, connections_limit=5)
# Add custom script
pipe.add_task(id='id_2', script='truncate table t1;', parent_id='id_1')
# Add SQL file script
pipe.add_task(id='id_1', script='queries/tables/t1.sql', file=True)
# Add all .sql in directory
pipe.map_directory('queries')
# Execute all pipeline
pipe.execute()
# Start from specifc task
pipe.execute('id_2')
Using CLI
Call the CLI and pass the directory (-d or --directory) parameter, after that all .sql files in the directory and subdirectories will be started. To configure a dependency just put the dependency in a comment on script file, example /* @parent=my-parent-task */.
python -m sqlpipe -d queries
It's possible to call specific task passing the task parameter (-t or --task).
python -m sqlpipe -d queries -t task-id
Supported Databases
- MySQL
- PostgreSQL
- Redshift
Licence 📜 Code released under the MIT license.
Metadata
Release files for sqlpipe 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sqlpipe-0.2.1.tar.gz | 3.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sqlpipe-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.2 kB
Release files / sqlpipe-0.2.1.tar.gz
| Download URL | sqlpipe-0.2.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11401bfbd141d36f2085e5d65883ffdde3ac91726098b5e78604988ce4cabb88
|
|
BLAKE2b-256 checksum How to use checksums |
4abe35c14e32199105fed22e22e2a7e8d1010d100f632128f46495c3c4d2f53c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.7
|
Release files / sqlpipe-0.2.1-py3-none-any.whl
| Download URL | sqlpipe-0.2.1-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5df9b9819e6f53a03d6cce359101e7a6fb77b3c43a265734e54703be5e79d4a0
|
|
BLAKE2b-256 checksum How to use checksums |
f9e3bdda0bc95ee79fd742ba7afc4f6549868d25521a98c4d5b697bb1d7567db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.7
|
Security for sqlpipe 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.