Data science oriented tools package
Project description
Data Tools
Data Science oriented tools package
Features
- Connection with differents databases to perform queries -- MySQL -- MongoDB
- Data Cleaning
Instalation
You can install this package using
pip install data-tools-traders-club
Usage
# Connection
## MySQL
### Import
from data_tools.connection.mongodb.api import MySQL
### Credentials
username = os.getenv('MYSQL_USERNAME')
password = os.getenv('MYSQL_PASSWORD')
host = os.getenv('MYSQL_HOST')
### Class Instantiation
mysql_in = MySQL(username, password, host)
### Query
schema = 'SCHEMA'
table = 'TABLE'
query = f"""SELECT * FROM {schema}.{table} LIMIT 100"""
df = mysql_in.select_query(query, schema)
## MongoDB
### Import
from data_tools.connection.mongodb.api import MongoDB
### Credentials
username = os.getenv('MONGODB_USERNAME')
password = os.getenv('MONGODB_PASSWORD')
host_string = os.getenv('MONGODB_HOST_STRING')
### Class Instantiation
mongodb_in = MongoDB(username, password, host_string)
### Pipeline
database = os.getenv('MONGODB_DATABASE_TEST')
collection = os.getenv('MONGODB_COLLECTION_TEST')
pipeline = [
{
'$project': {
'id': '$id'
}
}, {
'$limit': 10
}
]
df = mongodb_in.select_pipeline(database, collection, pipeline)
# tools
## DataCleaning
### Import
from data_tools.tools.api import DataCleaning
### Class Instantiation
clean = DataCleaning()
### Rename DataFrame (snake_case)
df = clean.rename_dataframe_snakecase(df)
### Rename DataFrame (CamelCase)
df = clean.rename_dataframe_camelcase(df)
Project Struture
root
├───data_tools
│ ├───connection
│ │ ├───mongodb
│ │ │ └── api.py
│ │ └───mysql
│ │ └── api.py
│ └───tools
│ └── api.py
├───tests
│ └───connection
│ ├───mongodb
│ │ └── test_api.py
│ └───mysql
│ └── test_api.py
├───venv ## Virtual enviroment (Local)
├───.env ## environmental variables (Local)
├───.gitignore
├───Authors.rst
├───CONTRIBUITING.md
├───History.md
├───LICENSE
├───Makefile
├───MANIFEST.in
├───README.md
├───requirements.txt
└───setup.py
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
Close
Hashes for data-tools-traders-club-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb592b3fc1208f759ab7c6ca9b71ad8bcb484e8f4bc366f3bac105f9b3f298a2 |
|
MD5 | 7a9e85435d41e867dd3efb049fb6ef52 |
|
BLAKE2b-256 | 988ae9b83c5bd49dc33f8eb768fa03a9ab7fca961f79b8f58e78f8143ae7ab70 |
Close
Hashes for data_tools_traders_club-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffb86c6f7e27b8c14e33ea74d1073dd624c3d41a8aeed46078fac6902e33341f |
|
MD5 | fc7dfda9517f3fc2c91815902a561be4 |
|
BLAKE2b-256 | bb1a2dff648b633511cb772f09dfd5dad70327122b03491c399045dae74f0431 |