guacamoleETL - Document
An ETL pipeline tool that
- pre-process
- extracts data from a .txt file (Challenge_me.txt)
- cleans up the data with invalid information
- transforms the data through given specifications into a matrix (list of lists)
- loads the data into a .csv file (output.csv)
Installation
This tool can be installed with pip
Copy-paste and run this command in the terminal
pip install guacamoleETL
Usage
This ETL pipeline can be part of predictive model training and feed the data directly to the model
import guacamoleETL
dataFile = 'Challenge_me.txt'
guacamoleETL.load(dataFile)
result = guacamoleETL.transform(dataFile)
predictive_model = model_training(result)
Functions
- extract_data(txt_file):
Extract data from a .txt file to a temporary .csv file
Leading or trailing whitespace are removed during the extraction - clean_up():
Clean up the data with invalid information
Rows with the placeholder '-' (NA) in any of the specified columns are excluded - transform(path):
Transform the data from pre-process through given specifications into a matrix
engine-locationis split into two columns,engine-location_frontandengine-location_rearand one-hot-encoded
num-of-cylindersis transformed from word into integer through a pre-defined dictionary
engine-sizeis transformed into integer
weightis transformed into integer
horsepoweris transformed from German decimal notation string into float number
aspirationis modified asaspiration_turboso that turbo engines are marked as 1
priceis converted from minor units to major units
makeis not transformed but kept in the dataset - load(path): Load the data from previous transformation into a .csv file
Architecture
All the functions are implemented in the __init__.py, this decision is made based on the following reasons:
- After the package is imported, if we want to use the transform and load functions directly as sub-module, the functions must be imported or defined in
__init__.py. - Since they are all connected to each other, such as the transform function takes the result from pre-process (extract and clean up) and the load function also takes the result from transform function, it's easier to follow the flow if they are all in the same file.
- This might not be the best architecture implementation, but while starting from small, simplicity is always a good consideration.
Release files for guacamoleETL 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| guacamoleETL-0.3.0.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| guacamoleETL-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.6 kB
Release files / guacamoleETL-0.3.0.tar.gz
| Download URL | guacamoleETL-0.3.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c5ccdcfec63b51a6c6e39ff6177b3b17f297e53927e12c7fbc178319b50c47a
|
|
BLAKE2b-256 checksum How to use checksums |
fef8f32e0da8ab4a45f488d7dd1cb49b31664624e831e45c5ef552d9e9e1e0fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2
|
Release files / guacamoleETL-0.3.0-py3-none-any.whl
| Download URL | guacamoleETL-0.3.0-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8cd67437a41fb259151da2682366e5c6806c5cb8316f02b3e97aaeb24a57fb3
|
|
BLAKE2b-256 checksum How to use checksums |
bcf4c0508079f244172f00f7353c59999e2ced8ab4e9c5b662facdcc0ae554b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2
|