Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paradigm_garlic-0.2.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

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

Hashes for paradigm_garlic-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f7413e01e2d57f54beb6f1d95975b90305e7c8098cefb99bf8588a9b47da6b64
MD5 b73a6b943b33c130c9404169554697ee
BLAKE2b-256 5a5e31416d8f9a972f8c624622a3f6217411c2f7117340647eb22dd941d10da4

See more details on using hashes here.

File details

Details for the file paradigm_garlic-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for paradigm_garlic-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af8673a2dff9d52d1c0a15b72832dc65dc904b7eb08d7891fb28d5905809e8e0
MD5 359be04be9ace0e9b8885674f986a43f
BLAKE2b-256 da2fce7ed832d548a992ba119bef4bf71a3e78b734bbbfbc93f99e55fb486b7f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page