Setup¶
1. Install¶
pip install snowmobile
2. Save snowmobile.toml¶
Download snowmobile-template.toml and save it in anywhere on your file system as snowmobile.toml.
3. Store Credentials¶
The first few lines of snowmobile.toml are outlined below; for minimum configuration, populate lines 6-12 with a valid set of Snowflake credentials.
2 3 4 5 6 7 8 9 10 11 12 | [connection]
default-creds = ''
[connection.credentials.creds1]
user = ''
password = ''
role = ''
account = ''
warehouse = ''
database = ''
schema = ''
|
FYI: see here if unfamiliar with .toml syntax
More Info
On line 3, default-creds enables specifying the default alias of the connection arguments to authenticate with by default if not specified in the creds parameter of snowmobile.connect().
If left empty and also not provided as a parameter, arguments under the alias creds1 will be authenticated with as it’s the first set of credentials stored at the level of connection.credentials.*
See Connector: Parameter Resolution for details on how determines what gets passed to snowflake.connector.connect()
4. Connect to Snowflake¶
Successful setup and connection can be verified with:
import snowmobile
sn = snowmobile.connect()
"""
Looking for snowmobile.toml in local file system..
(1 of 1) Located 'snowmobile.toml' at ../Snowmobile/snowmobile.toml
..connected: snowmobile.Snowmobile(creds='creds1')
"""