Skip to main content

A package to ease interaction with cloud services, DB connections and commonly used functionalities in data analytics.

Project description

Instackup

This Python library is an open source way to standardize and simplify connections with cloud-based tools, databases and commonly used tools in data manipulation and analysis. It can help BI teams by having a unified source code for local development and testing as well as remote production (automated scheduled run) environments.

Index

Current release

Version 0.2.3 (beta)

Prerequisites

  1. Have a Python 3.6 version or superior installed;
  2. Create a YAML (or JSON) file with credentials information;
  3. [Optional but recommended] Configure an Environment Variable that points where the Credentials file is.

1. Have a Python 3.6 version or superior installed

Got to this link e download the most current version that is compatible with this package.

2. Create a YAML (or JSON) file with credentials information

Use the files secret_template.yml or secret_blank.yml as a base or copy and paste the code bellow and modify its values to the ones in your credentials/projects:

#################################################################
#                                                               #
#        ACCOUNTS CREDENTIALS. DO NOT SHARE THIS FILE.          #
#                                                               #
# Specifications:                                               #
# - For the credentials you don't have, leave it blank.         #
# - Keep Google's secret file in the same folder as this file.  #
# - BigQuery project_ids must be strings, i.e., inside quotes.  #
#                                                               #
# Recommendations:                                              #
# - YAML specification: https://yaml.org/spec/1.2/spec.html     #
# - Keep this file in a static path like a folder within the    #
# Desktop. Ex.: C:\Users\USER\Desktop\Credentials\secret.yml    #
#                                                               #
#################################################################

Location: local


Google:
  secret_filename: file.json

BigQuery:
  project_id:
    project_name: "000000000000"


AWS:
  access_key: AWSAWSAWSAWSAWSAWSAWS
  secret_key: CcasldUYkfsadcSDadskfDSDAsdUYalf

RedShift:
  cluster_credentials:
    dbname: db
    user: masteruser
    host: blablabla.random.us-east-2.redshift.amazonaws.com
    cluster_id: cluster
    port: 5439
  master_password:
    dbname: db
    user: masteruser
    host: blablabla.random.us-east-2.redshift.amazonaws.com
    password: masterpassword
    port: 5439


PostgreSQL:
  default:
    dbname: postgres
    user: postgres
    host: localhost
    password:
    port: 5432


MySQL:
  default:
    dbname: mydb
    host: localhost
    user: root
    password:
    port: 3306

Save this file with .yml extension in a folder where you know the path won't be modified, like the Desktop folder (Example: C:\Users\USER\Desktop\Credentials\secret.yml).

If you prefer, you can follow this step using a JSON file instead. Follow the same instructions but using .json instead of .yml.

3. [Optional but recommended] Configure an Environment Variable that points where the Credentials file is.

To configure the Environment Variable, follow the instructions bellow, based on your Operating System.

Windows

  1. Place the YAML (or JSON) file in a folder you won't change its name or path later;
  2. In Windows Search, type Environment Variables and click in the Control Panel result;
  3. Click on the button Environment Variables...;
  4. In Environment Variables, click on the button New;
  5. In Variable name type CREDENTIALS_HOME and in Variable value paste the full path to the recently created YAML (or JSON) file;
  6. Click Ok in the 3 open windows.

Linux/MacOS

  1. Place the YAML (or JSON) file in a folder you won't change its name or path later;
  2. Open the file .bashrc. If it doesn't exists, create one in the HOME directory. If you don't know how to get there, open the Terminal, type cd and then ENTER;
  3. Inside the file, in a new line, type the command: export CREDENTIALS_HOME="/path/to/file", replacing the content inside quotes by the full path to the recently created YAML (or JSON) file;
  4. Save the file and restart all open Terminal windows.

Note: If you don't follow this last prerequisite, you need to set the environment variable manually inside the code. To do that, inside your python code, after the imports, type the command (replacing the content inside quotes by the full path to the recently created YAML (or JSON) file):

os.environ["CREDENTIALS_HOME"] = "/path/to/file"

Installation

Go to the Terminal and type:

pip install instackup

Documentation

Check the documentation by clicking in each topic.

Version logs

See what changed in every version.

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

instackup-0.2.3.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

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

instackup-0.2.3-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file instackup-0.2.3.tar.gz.

File metadata

  • Download URL: instackup-0.2.3.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for instackup-0.2.3.tar.gz
Algorithm Hash digest
SHA256 e75615c6fb2ef575bdd948e04398010038210c98782aeda24f3bcc76fafcede0
MD5 42b5599487ae896893229da8d44a9575
BLAKE2b-256 c4e2d0eb71890b29728941863c2ee6b2d61ff1ba0c46f1117c6ac1779b770c85

See more details on using hashes here.

File details

Details for the file instackup-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: instackup-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for instackup-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8e33bbdbe1b1c5605d9656fa9e72042afd0bc6758e0fad58a4898933b78ac72e
MD5 80ef8952cd9e4bc7fe89160b4ccf8c78
BLAKE2b-256 69f0f6a3f1fa923d5538e7f87c034dbfc15122a8a4a8fc069820da6695c89e31

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