Data transfer utilities between files and databases
Project description
Easy Data Loader 🚀
Easy Data Loader is a flexible, modular Python library designed to streamline ETL (Extract, Transform, Load) processes between various file data sources (csv, xlsx, parquet, orc) and databases (MSSQL, PostgreSQL and others).
✨ Key Features
- Declarative Configuration: Manage connections and pipelines through simple python files and
.envresources. - Integrated CLI: Initialize a standardized project structure with a single command.
- Custom Transformation Hooks: Inject your own Pandas transformation logic directly into the pipeline execution.
- Performance Optimized: Built-in support for chunked loading and writing to handle large datasets efficiently.
- Extensible Architecture: Uses a Factory Pattern for database connectors, making it easy to support new drivers.
📦 Installation
Install directly via pip or uv:
pip install easy_data_loader
uv add easy_data_loader
🚀 Getting Started
- Initialize a new project structure to generate template configurations:
easy-data-loader init - Review the generated
config/folders for sample resources and pipelines. - Run all discovered pipelines across the active configurations:
easy-data-loader run_all
✔️ Generic concepts
easy_data_loader uses resources as a way to define a file or a database. The resouces can represent either a source or a destination making posible the folowing ETL scenarios: file -> file, file -> database, database -> file, database -> database.
easy_data_loader project initializer will created the predefined folder structure /config/resources where the resources are expected to be defined following the current convention: the file type is .env and the file name must be prefixed with the resource type file_ or database_. The predefined folder structure together with the naming convention enables easy_data_loader to find and load all resources.
A secondary predefined folder /config/pipelines will contain the pipeline definition files, which are regular Python files. There are 3 types of pipelines that can be defined:
LoadPipelinethe main pipeline type which transports data from source to destinationProcedurePipelinea pipeline dedicated for executing stored procedures inside a databaseOrchestratorPipelinea pipeline that can execute a group of pipelines sequentialy
LoadPipeline
In order to define a LoadPipeline we must use the BasePipelineDefinition from easy_data_loader as depicted in the example pipelines created by the initializer.
In the simplest form there are only a few mandatory parameters:
pipeline_name : str- this name will be used to execute the pipelinesource : str- the file name (without extension) coresponding to the desired resource to be the data sourcedestination : str- the file name (without extension) coresponding to the desired resource to be the data destination
If either the source or destination are a database then additional parameters become mandatory:
source_sql : str- can be a table name or a specific query in the SQL dialect of the source database flavordestination_table : str- table name where the data will be inserted
There are many other aspects of the pipeline that can be defined:
audit : str- the pipeline has a built in audit functionality, it records certain information after the pipeline completes in a SqlLite database. If the user desires, the same information can be recorded in a databaseresourcevalidator: Pydantic BaseModel- the data read from the sourceresourcecan be validated using an arbitrary defined Pydantic model before is written to destinationcolumns : Dict[str, ColumnDefinition]- this parameter is used for strict control on how the data is written to destination; it has the dual purpose of renaming the columns and also define explicitly the data types (mainly for inserting into a database table); theColumnDefinitionis constructed with an optionaltarget_name: strfor renaming columns and / or adata_type : SqlAlchemy Typethus controling column data types, lenghts, precision etc.read_parameters : Dict[str, Any]andwrite_parameters : Dict[str, Any]- these parameters control how the data is being read or written from source to destination and provide an easy way to use special delimiters for files, drop and recreate the database table, etc.easy_data_loaderis using pandas as the transport layer therefore the read and write parameters will be passed to the coresponding read and write functions supported by pandas.- the pipeline has a set of predefined hooks allowing the execution of functions at specific moments during the execution:
file_pre_process : Callable- executed before the file is read into the pandas DataFrame (e.g. unzip the file);transform : Callable- perform data transformation over the data already in the pandas DataFrame (requires pandas methods);file_post_process : Callable- after the pipeline completes and the data is written to the destination perform post processing on the source file (e.g. move the file to another folder)
ProcedurePipeline
This secondary pipeline type is responsible for executing one or more stored procedures inside a database.
To define one we need to use the ProcedureDefinition with the following parameters:
pipeline_name : str- this name will be used to execute the pipelineaudit : str, optional- database resource name where the audit info will be recordedresource : str- database resource name where the stored procedure(s) wil be executedprocedures : List[tuple(str, Optional[Dict[str, Any]])]- list of one or more stord procedures along with optional procedures parameters as dictionaries
OrchestratorPipeline
This pipeline type is responsible of executing sequentially a set of pipelines, LoadPipelines and / or ProcedurePipelines. Very simple to define using the OrchestratorDefinition with:
orchestrator_name : str- name by which the orchestrator is executer- 'pipelines : List[str]` - list of pipelines to execute sequentially
fail_fast : bool, Default True- if any of the pipelines fail the rest of the pipelines in the list do not get executed
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy_data_loader-0.1.4.tar.gz.
File metadata
- Download URL: easy_data_loader-0.1.4.tar.gz
- Upload date:
- Size: 39.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c59825f780b63b98a5c68baaeda29cd8521eee3fa86a8f1935a7ed60e80ac3e
|
|
| MD5 |
44d2ea41e7832dc0cb92ad2179c2b312
|
|
| BLAKE2b-256 |
c9540d9a1c95ab907e05ec1ecbd0b9f3be3756868cb7c2d5e988f4888303b02f
|
Provenance
The following attestation bundles were made for easy_data_loader-0.1.4.tar.gz:
Publisher:
publish.yml on whatever82/easy_data_loader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easy_data_loader-0.1.4.tar.gz -
Subject digest:
5c59825f780b63b98a5c68baaeda29cd8521eee3fa86a8f1935a7ed60e80ac3e - Sigstore transparency entry: 1678842866
- Sigstore integration time:
-
Permalink:
whatever82/easy_data_loader@f935ba3d92de1aca9203e041b5b24840a5e7ecde -
Branch / Tag:
refs/heads/main - Owner: https://github.com/whatever82
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f935ba3d92de1aca9203e041b5b24840a5e7ecde -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file easy_data_loader-0.1.4-py3-none-any.whl.
File metadata
- Download URL: easy_data_loader-0.1.4-py3-none-any.whl
- Upload date:
- Size: 35.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be588ee7e4e425e32ab6a30fe8e0d663e0ce93ae72583498edafc1de1ad5df1c
|
|
| MD5 |
2f7c3a33c3d52ec989559050e0ceb236
|
|
| BLAKE2b-256 |
133881b87374438422a533de4b797ff26bd869db17c3f3a47a4299efe68ca998
|
Provenance
The following attestation bundles were made for easy_data_loader-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on whatever82/easy_data_loader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easy_data_loader-0.1.4-py3-none-any.whl -
Subject digest:
be588ee7e4e425e32ab6a30fe8e0d663e0ce93ae72583498edafc1de1ad5df1c - Sigstore transparency entry: 1678843009
- Sigstore integration time:
-
Permalink:
whatever82/easy_data_loader@f935ba3d92de1aca9203e041b5b24840a5e7ecde -
Branch / Tag:
refs/heads/main - Owner: https://github.com/whatever82
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f935ba3d92de1aca9203e041b5b24840a5e7ecde -
Trigger Event:
workflow_dispatch
-
Statement type: