Skip to main content

handy tools to connect the various data sources

Project description

variousconnector

handy tools to connect the various data sources

What are the Key Features?

  1. Support PostgreSQL with SSH functionality.
  2. Support Snowflake

How to Install?

Use the package manager pip to install.

pip install variousconnector

How to Use?

PostgreSQL

from variousconnector import postgresql_connector

postgresql_credential = {
        "host":"your_db_server_url",
        "port":5432,
        "user":"your_user_name",
        "pwd":"your_password",
        "ssh_enable":True, # require SSH if using VPN
        "ssh_host":"your_ssh_host", # not require if ssh_enable is False
        "ssh_user":"your_ssh_user", # not require if ssh_enable is False
        "ssh_pwd":"your_ssh_password" # not require if ssh_enable is False
        }

pg = postgresql_connector(credential = postgresql_credential)

query = '''
    select *
    from table_name
    '''

query_result = pg_nossh.query(db='your_db_name',
                              query=query
                              )

Snowflake

from variousconnector import snowflake_connector

snowflake_credential = {
        'account':'XXXX',
        'user':'XXXX',
        'pwd':'XXXX',
        'warehouse':'XXXX'
    }

sw = snowflake_connector(credential = snowflake_credential)

query = '''
    select *
    from table_name
    '''

query_result = sw.query(db='your_db_name',
                        query=query
                        )

'''
how to know my snowflake account?
if your URL is "https://abc.snowflakecomputing.com/", then your Snowflake account name is "abc". 
If you are in any other region (such as AWS US-EAST), then if your URL is "https://xyz.us-east-1.snowflakecomputing.com/", then your account name is "xyz"
'''

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

variousconnector-1.1.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file variousconnector-1.1.tar.gz.

File metadata

  • Download URL: variousconnector-1.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for variousconnector-1.1.tar.gz
Algorithm Hash digest
SHA256 a33c260a12ed936237592a8061c0f86fbb042a5e1418226591fd527601791c88
MD5 8540c39ee2ba8316b7ac5a296caf9308
BLAKE2b-256 da6d8a32a943e8066024fb9c946d5d74ed5c8ba16157e4197da316d3df5a4ad4

See more details on using hashes here.

Supported by

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