Skip to main content

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.mysql.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

data-tools-traders-club-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

data_tools_traders_club-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file data-tools-traders-club-0.1.0.tar.gz.

File metadata

  • Download URL: data-tools-traders-club-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5

File hashes

Hashes for data-tools-traders-club-0.1.0.tar.gz
Algorithm Hash digest
SHA256 18d5499e0efc14c671ed72938f669ccab2c18e8c9e1fd041967c70b69cdd94f1
MD5 d352a946083ac3fbd962adfb0cae9ff3
BLAKE2b-256 aeb1de7590113b62d8341e5efcd0197fe7ad8f24391b05a2b08291ceb58561a9

See more details on using hashes here.

File details

Details for the file data_tools_traders_club-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: data_tools_traders_club-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5

File hashes

Hashes for data_tools_traders_club-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e995705c0488ce0d8fab18219f5ab2db314f5f9c731918f99bf7829922935e7f
MD5 0378eaf8bef2bf08c90429df7130f078
BLAKE2b-256 c0e42cdc4721feb9d3047e0fae3fb367a6aea82975a45b5a1e52df47632f985a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page