# Snowflake Query Engine Pack
This LlamaPack uses `snowflake-sqlalchemy` to connect to Snowflake, then calls `NLSQLTableQueryEngine` to query data.
## Usage
You can download the pack to a the `./snowflake_pack` directory:
```python
from llama_index.core.llama_pack import download_llama_pack
# download and install dependencies
SnowflakeQueryEnginePack = download_llama_pack(
"SnowflakeQueryEnginePack", "./snowflake_pack"
)
```
From here, you can use the pack, or inspect and modify the pack in `./snowflake_pack`.
`NLSQLTableQueryEngine` uses OpenAI models by default, ensure you set your OpenAI API key.
You can set up the pack by passing in the Snowflake connection details and the table(s):
```python
# create the pack
snowflake_pack = SnowflakeQueryEnginePack(
user="<USER>",
password="<PASSWORD>",
account="<ORG>-<ACCOUNT>",
database="<DATABASE>",
schema="<SCHEMA>",
warehouse="<WAREHOUSE>",
role="<ROLE>",
tables=["<TABLE1>", "<TABLE2>", ...],
)
```
The `run()` function is a light wrapper around `query_engine.query()`. See below a sample query run. You can add additional prompt in the query text.
```python
response = snowflake_pack.run(
"Give me the repo id with the most stars on 2023-12-01."
)
```
Raw data
{
"_id": null,
"home_page": "",
"name": "llama-index-packs-snowflake-query-engine",
"maintainer": "wenqiglantz",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0",
"maintainer_email": "",
"keywords": "engine,query,snowflake",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/74/c5/489bde06d29dcc03c00edba8b83133918b55ba09e24da44a58f3143b9c0f/llama_index_packs_snowflake_query_engine-0.1.3.tar.gz",
"platform": null,
"description": "# Snowflake Query Engine Pack\n\nThis LlamaPack uses `snowflake-sqlalchemy` to connect to Snowflake, then calls `NLSQLTableQueryEngine` to query data.\n\n## Usage\n\nYou can download the pack to a the `./snowflake_pack` directory:\n\n```python\nfrom llama_index.core.llama_pack import download_llama_pack\n\n# download and install dependencies\nSnowflakeQueryEnginePack = download_llama_pack(\n \"SnowflakeQueryEnginePack\", \"./snowflake_pack\"\n)\n```\n\nFrom here, you can use the pack, or inspect and modify the pack in `./snowflake_pack`.\n\n`NLSQLTableQueryEngine` uses OpenAI models by default, ensure you set your OpenAI API key.\n\nYou can set up the pack by passing in the Snowflake connection details and the table(s):\n\n```python\n# create the pack\nsnowflake_pack = SnowflakeQueryEnginePack(\n user=\"<USER>\",\n password=\"<PASSWORD>\",\n account=\"<ORG>-<ACCOUNT>\",\n database=\"<DATABASE>\",\n schema=\"<SCHEMA>\",\n warehouse=\"<WAREHOUSE>\",\n role=\"<ROLE>\",\n tables=[\"<TABLE1>\", \"<TABLE2>\", ...],\n)\n```\n\nThe `run()` function is a light wrapper around `query_engine.query()`. See below a sample query run. You can add additional prompt in the query text.\n\n```python\nresponse = snowflake_pack.run(\n \"Give me the repo id with the most stars on 2023-12-01.\"\n)\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index packs snowflake_query_engine integration",
"version": "0.1.3",
"project_urls": null,
"split_keywords": [
"engine",
"query",
"snowflake"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b1f2519b6a431efc07ac62744e60cc1238b31cfde2517fe436881067c9c52b69",
"md5": "95c6c8bf545340b82566835559825ffa",
"sha256": "76fd8e8011784ce147bda8307be140320353b34541129bdf2f8b1bf8d1ab80af"
},
"downloads": -1,
"filename": "llama_index_packs_snowflake_query_engine-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "95c6c8bf545340b82566835559825ffa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0",
"size": 3419,
"upload_time": "2024-02-22T01:38:38",
"upload_time_iso_8601": "2024-02-22T01:38:38.115752Z",
"url": "https://files.pythonhosted.org/packages/b1/f2/519b6a431efc07ac62744e60cc1238b31cfde2517fe436881067c9c52b69/llama_index_packs_snowflake_query_engine-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "74c5489bde06d29dcc03c00edba8b83133918b55ba09e24da44a58f3143b9c0f",
"md5": "e35122d4ce85458a5dc112960dafc2aa",
"sha256": "c1f922f8bddeb9e334a2063671ba78356e0919d1ab7878a5b2fc17c2a8a61686"
},
"downloads": -1,
"filename": "llama_index_packs_snowflake_query_engine-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "e35122d4ce85458a5dc112960dafc2aa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0",
"size": 3000,
"upload_time": "2024-02-22T01:38:39",
"upload_time_iso_8601": "2024-02-22T01:38:39.341112Z",
"url": "https://files.pythonhosted.org/packages/74/c5/489bde06d29dcc03c00edba8b83133918b55ba09e24da44a58f3143b9c0f/llama_index_packs_snowflake_query_engine-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-22 01:38:39",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-packs-snowflake-query-engine"
}