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

Uploaded Source

File details

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

File metadata

  • Download URL: variousconnector-1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 ceaadca6efcf9f3a2a3082f0b1a45556b5c3295e4adc2d136c47b2f1dcc85c6f
MD5 af9df13b4afa9b259be3be666b193e43
BLAKE2b-256 84ecdbdea7c2b7c9ff94755ddb71a6896bbac71e939a4fab22a4342592957c34

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