This repository provides a collection of utility functions and classes for data cleaning, SQL query generation, and data analysis. The code is written in Python and uses libraries such as `pandas`, `numpy`, and `dateutil`.
Project description
Project Documentation
Table of Contents
Overview
This project provides a comprehensive Data ETL (Extract, Transform, Load) and data manipulation framework using Python. It integrates with databases using SQLAlchemy and provides tools for data parsing, cleaning, loading, validating, and more. The project is structured with classes that encapsulate different functionalities.
Classes
Connector
The Connector class handles creating connections to various types of databases (MSSQL, PostgreSQL, MySQL) using SQLAlchemy. It provides static methods for obtaining both trusted and user connections.
Key Methods:
get_mssql_trusted_connectionget_mssql_user_connectionget_postgres_user_connectionget_mysql_user_connection- Instance methods for returning database connections based on stored configuration.
Loader
The Loader class is responsible for loading data from a Pandas DataFrame into a database. It manages the insertion process, ensuring data is inserted efficiently and effectively with the use of SQLAlchemy and custom logging.
MySqlLoader
A slight extension of the Loader class specifically for MySQL databases. It provides overrides to manage MySQL-specific data types and query formatting.
MsSqlLoader
A specialized loader for loading data into MSSQL databases with additional functionalities like fast insertions using bulk methods.
Parser
The Parser class consists of a series of static methods dedicated to parsing various data types—boolean, float, date, and integer. These methods are essential for data type conversion and consistency across the application.
Cleaner
The Cleaner class provides methods for sanitizing and formatting data in a DataFrame. It includes functions for setting column name casing conventions, cleaning various types of data, and preparing data for reliable analysis and insertion.
Creator
This class deals with generating SQL CREATE TABLE statements for different databases like MSSQL and MariaDB. The query generation considers data types deduced from DataFrame content.
Analyzer
The Analyzer class assesses DataFrame characteristics and helps identify unique columns, column pairs, empty columns, and more. It aids in generating metadata for data types, which is crucial for creating or validating schemas.
Validator
The Validator class ensures DataFrame compatibility with the target database table structure by checking for extra columns, validating data types, and ensuring that no data truncation will occur during upload.
MsSqlUpdater
A class designed for constructing SQL statements for operations like mergers, updates, inserts, and appends to manage data transitions between tables efficiently.
Logging
The project uses a singleton Logger class with colored output format for console logging. This helps in debugging and understanding the flow by logging messages at various severity levels.
Additional Utilities
- Parsing and Cleaning Functions: Utility functions for parsing and cleaning various data types.
- Standardization: A set of utility functions to standardize and clean DataFrame column names and content.
Project details
Release history Release notifications | RSS feed
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 etl_utilities-1.2.0.tar.gz.
File metadata
- Download URL: etl_utilities-1.2.0.tar.gz
- Upload date:
- Size: 53.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aed6016e3c40e5722d3b629cac5add35a006ba5e1b9f8157725126c7c3a36c5e
|
|
| MD5 |
d7957c65231767bc83dc13101413b2f3
|
|
| BLAKE2b-256 |
daa258757fb5118067818bc4a98420b0266f4d71447ac2f72d9683fe9b423d5c
|
Provenance
The following attestation bundles were made for etl_utilities-1.2.0.tar.gz:
Publisher:
publish.yml on magicjedi90/etl_utilities
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
etl_utilities-1.2.0.tar.gz -
Subject digest:
aed6016e3c40e5722d3b629cac5add35a006ba5e1b9f8157725126c7c3a36c5e - Sigstore transparency entry: 1001693402
- Sigstore integration time:
-
Permalink:
magicjedi90/etl_utilities@ac278d87c881f6ee5f90e4ce9dbbe3e5f7e253af -
Branch / Tag:
refs/heads/main - Owner: https://github.com/magicjedi90
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac278d87c881f6ee5f90e4ce9dbbe3e5f7e253af -
Trigger Event:
push
-
Statement type:
File details
Details for the file etl_utilities-1.2.0-py3-none-any.whl.
File metadata
- Download URL: etl_utilities-1.2.0-py3-none-any.whl
- Upload date:
- Size: 49.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e1737573e8c81ac5aff9eca2ff3ce3ed4d2be9b0227d1e518b65abc7cd22b9d
|
|
| MD5 |
2a8da9af31a8149b8327ec6cf43d2d20
|
|
| BLAKE2b-256 |
2bef46767440388e34a6c0fc0a44a00b75a5e44beb93104aa26677d454ef4aeb
|
Provenance
The following attestation bundles were made for etl_utilities-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on magicjedi90/etl_utilities
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
etl_utilities-1.2.0-py3-none-any.whl -
Subject digest:
9e1737573e8c81ac5aff9eca2ff3ce3ed4d2be9b0227d1e518b65abc7cd22b9d - Sigstore transparency entry: 1001693408
- Sigstore integration time:
-
Permalink:
magicjedi90/etl_utilities@ac278d87c881f6ee5f90e4ce9dbbe3e5f7e253af -
Branch / Tag:
refs/heads/main - Owner: https://github.com/magicjedi90
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac278d87c881f6ee5f90e4ce9dbbe3e5f7e253af -
Trigger Event:
push
-
Statement type: