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.21.tar.gz (3.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: variousconnector-1.21.tar.gz
  • Upload date:
  • Size: 3.8 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.21.tar.gz
Algorithm Hash digest
SHA256 bcb813d3c765bb2e5e2df3645f55e492ce5b4f28170dac2e78455ba1f4b61a82
MD5 9550004c232bd203beb9fb34f7a2a49b
BLAKE2b-256 e0e9f9c50a535b481891c16a3069c89b58def03b24abf183e52d723ccecca7da

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