Skip to main content
Version: 3.2

Connectors

Connector example to get the data from SNOWFLAKE.โ€‹

snowflake-credentials.json

{
"USER": "username",
"PASSWORD": "password",
"ACCOUNT": "id.uae-north.azure",
"DATABASE": "SNOWFLAKE_SAMPLE_DATA",
"TABLE_NAME": "CUSTOMER",
"SCHEMA": "TPCH_SF1",
"WAREHOUSE": "COMPUTE_WH"
}
# Define all your configurations inside a JSON file.
import json

with open('snowflake-credentials.json') as f:
config = json.load(f)

Initializing the SnowFlakeConnector with the provided credentials and configuration.

from katonic.connectors.python.snowflake import SnowFlakeConnector

df = SnowFlakeConnector(
user=config["USER"],
password=config["PASSWORD"],
account=config["ACCOUNT"],
database=config["DATABASE"],
table_name=config["TABLE_NAME"],
schema=config["SCHEMA"],
warehouse=config["WAREHOUSE"],
query="SELECT * FROM TPCH_SF1.CUSTOMER",
output="local",
file_name="driver_data",
)
df.get_data()
>>> Connection to snowflake stablished Successfully.
>>> File saved to your 'local' file system with name 'snowflake_TPCH_SF1_SNOWFLAKE_SAMPLE_DATA_driver_data_2022_04_20_08_46_38.csv' Successfully.