ETL tooling for tableau seed data
Project description
TableauTransformer
ETL tooling for preparing tableau seed data
Description
This library was built with the intentions of enhancing the experience of data wrangling for tableau. Tableau can be very particular about the data it reads from. In addition preparing data to fit the shape for different graphs can be time consuming. TableauTransformer can be used to hurdle over these two barriers.
Dependencies
- pip, python 3.6, pandas, numpy
Getting Started
pip install tableautransformer
import tableautransformer as tbt
tbt is a collection of functions, not a collection of methods, so all calls are "tbt.function_name()"
Function Docs
Here you can find a list of all functions within the library, a description of what they do, and their inputs.
:large_blue_diamond: Basic_Table
basic_table(read_path, read_type='csv', sheet_name=None, columns_to_keep=None, columns_rename=None,
filters=None, group_by=None, aggregate_columns=None, pre_agg_math_columns=None,
post_agg_math_columns=None, remove_NAN=True, remove_NAN_col='all')
Description
basic_table is the basis for the tbt library as it refactors ~20 lines of commonly repeated code down to one input heavy function. The function reads in a dataframe, cleans up the data, and performs commonly used table operations.
Inputs
read_path: string
The path to the file you wish to read. The only mandatory input.
read_type: 'csv' or 'excel'
Default is csv, if type is excel then sheet_name must have a value.
sheet_name: string
The name of the tab you wish to read in.
columns_to_keep: list of strings
['colA','colB','colC'] This function runs immediately after reading in the data, any column mentioned in the list will remain in the dataframe, all others are dropped.
columns_rename: list of strings
['colA','colB','colC'] the renaming process occurs after the file is read in and columns_to_keep have been selected. All other column related inputs should use the new name dictated by the rename process.
filters: list of 3-element tuples
[('col_name','operand','value')] the input can be multiple filters, each filter is a 3-element tuple where the first element is the column name, the second is the operand, and the third is the value. The column name and operand must be strings while the value can be numeric (or a string if the operand is '==').
group_by
aggregate_columns
pre_agg_math_columns
post_agg_math_columns
remove_NAN
remove_NAN_col
Example
:large_blue_diamond: Bucket
bucket(df, column, bucket_col_name, intervals)
Description
Inputs
Example
:large_blue_diamond: Is_In
is_in(df, target_col, isin_list)
Description
Inputs
Example
:large_blue_diamond: Cast
cast(df, target_col, value)
Description
Inputs
Example
Date_Format
date_format(df, target_col, date_format)
Description
Inputs
Example
Authors
Contributors names and contact info
- Josh Teixeira | jteixeira@cppib.com
Version History
- 0.0.17
- README documentation added
- 0.0.16
- bucket function added
- 0.0.1
- Initial beta release
License
This project is licensed under the MIT License - see the LICENSE.md file for details
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
Hashes for tableautransformer-0.0.20.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3898d98aee9d8df998ffc8162c0c435e69dd19095f8ce22b6c8b11de8a79745b |
|
MD5 | 92e10bc8d8e9ec91583fc741eae1b21c |
|
BLAKE2b-256 | c0f4f3cd202e92c255eeb892a81da1751fb77b87a6737fd979220b057cb11a06 |
Hashes for tableautransformer-0.0.20-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 850a37f624039f0ebbd85b4dd44822d1252c5bf82a7e117b3404f81e6610752f |
|
MD5 | bdf11e07737ba0b5be7270a9845f56aa |
|
BLAKE2b-256 | 568cbca44d9a2542d245505270548e40546704910dce7f4a4b0fcee05f2b6afc |