Skip to content

ronmorgen1/snowflake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snowflake Connector

The purpose of this connector is to provide a simple way to connect to Snowflake. Currently, it is only used for internal purposes.


Installation

Clone the repository and go to the root directory:

git clone https://github.com/ronmorgen1/snowflake.git && cd snowflake

Run the setup script to install dependencies:

python setup.py install

Basic Usage

create a python file named snowflake.py and import the connector, use your credentials to connect: Basic Query:

from Snowflake.snowflake import Snowflake

with Snowflake("<pagaya_email>", "<pagaya_password>") as conn:
    res = conn.execute_simple("SELECT * FROM LOANS LIMIT 100")
    print(res)

Run a query that returns a pandas dataframe:

from Snowflake.snowflake import Snowflake

with Snowflake("<pagaya_email>", "<pagaya_password>") as conn:
    res = conn.execute_to_df("SELECT * FROM LOANS LIMIT 10;")
    print(res)

From SQL File:

Create a file named query.sql and write the query in it:

SELECT *
FROM LOANS
LIMIT 100;

Run the query from snowflake.py:

from Snowflake.snowflake import Snowflake

with Snowflake("<pagaya_email>", "<pagaya_password>") as conn:
    res = conn.execute_file('./query.sql')
    print(res)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages