garlic is a cli and python interface for Allium data
Project description
garlic 🧄
cli and python interface for interacting with Snowflake
Features
- run queries against snowflake using simple UX
- auto-convert query results to polars dataframes
- convenience functions for:
- formatting timestamps for use in SQL queries
- setting the warehouse
- listing databases, schemas, tables, and query history
Installation
uv add paradigm_garlic
Usage Example
Simplest example
import garlic
dataframe = garlic.query('SELECT * FROM my_table')
Query using custom credentials
import garlic
dataframe = garlic.query('SELECT * FROM my_table')
Set different default warehouse:
import garlic
garlic.set_warehouse('BIG_WAREHOUSE')
dataframe = garlic.query('SELECT * FROM my_table')
Read from Snowflake management tables
import garlic
databases = garlic.list_databases()
schemas = garlic.list_schemas()
tables = garlic.list_tables()
query_history = garlic.list_query_history()
Use timestamps in CLI queries
import garlic
import datetime
sql = """
SELECT *
FROM my_table
WHERE
block_timestamp >= {start_time}
AND block_timestamp < {end_time}
""".format(
start_time=garlic.format_timestamp('2024-01-01', utc=True),
end_time=garlic.format_timestamp(datetime.datetime.now(), utc=True),
)
dataframe = garlic.query(sql)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
paradigm_garlic-0.2.0.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paradigm_garlic-0.2.0.tar.gz.
File metadata
- Download URL: paradigm_garlic-0.2.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7413e01e2d57f54beb6f1d95975b90305e7c8098cefb99bf8588a9b47da6b64
|
|
| MD5 |
b73a6b943b33c130c9404169554697ee
|
|
| BLAKE2b-256 |
5a5e31416d8f9a972f8c624622a3f6217411c2f7117340647eb22dd941d10da4
|
File details
Details for the file paradigm_garlic-0.2.0-py3-none-any.whl.
File metadata
- Download URL: paradigm_garlic-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af8673a2dff9d52d1c0a15b72832dc65dc904b7eb08d7891fb28d5905809e8e0
|
|
| MD5 |
359be04be9ace0e9b8885674f986a43f
|
|
| BLAKE2b-256 |
da2fce7ed832d548a992ba119bef4bf71a3e78b734bbbfbc93f99e55fb486b7f
|