# Snowflake Loader
This loader connects to Snowflake (using SQLAlchemy under the hood). The user specifies a query and extracts Document objects corresponding to the results. You can use this loader to easily connect to a database on Snowflake and pass the documents into a `GPTSQLStructStoreIndex` from LlamaIndex.
## Usage
### Option 1: Pass your own SQLAlchemy Engine object of the database connection
Here's an example usage of the SnowflakeReader.
```python
from llama_index import download_loader
SnowflakeReader = download_loader("SnowflakeReader")
reader = SnowflakeReader(
engine=your_sqlalchemy_engine,
)
query = "SELECT * FROM your_table"
documents = reader.load_data(query=query)
```
### Option 2: Pass the required parameters to esstablish Snowflake connection
Here's an example usage of the SnowflakeReader.
```python
from llama_index import download_loader
SnowflakeReader = download_loader("SnowflakeReader")
reader = SnowflakeReader(
account="your_account",
user="your_user",
password="your_password",
database="your_database",
schema="your_schema",
warehouse="your_warehouse",
role="your_role", # Optional role setting
proxy="http://proxusername:proxypassword@myproxy:port", # Optional proxy setting
)
query = "SELECT * FROM your_table"
documents = reader.load_data(query=query)
```
#### Author
[Godwin Paul Vincent](https://github.com/godwin3737)
This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent. See [here](https://github.com/emptycrown/llama-hub/tree/main) for examples.
Raw data
{
"_id": null,
"home_page": "",
"name": "llama-index-readers-snowflake",
"maintainer": "godwin3737",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0",
"maintainer_email": "",
"keywords": "data warehouse,database,snowflake,warehouse",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/2d/44/623f83e38fee89e93b04cad9df4d3883694e3c565a705ce253d6a5547eac/llama_index_readers_snowflake-0.1.3.tar.gz",
"platform": null,
"description": "# Snowflake Loader\n\nThis loader connects to Snowflake (using SQLAlchemy under the hood). The user specifies a query and extracts Document objects corresponding to the results. You can use this loader to easily connect to a database on Snowflake and pass the documents into a `GPTSQLStructStoreIndex` from LlamaIndex.\n\n## Usage\n\n### Option 1: Pass your own SQLAlchemy Engine object of the database connection\n\nHere's an example usage of the SnowflakeReader.\n\n```python\nfrom llama_index import download_loader\n\nSnowflakeReader = download_loader(\"SnowflakeReader\")\n\nreader = SnowflakeReader(\n engine=your_sqlalchemy_engine,\n)\n\nquery = \"SELECT * FROM your_table\"\n\ndocuments = reader.load_data(query=query)\n```\n\n### Option 2: Pass the required parameters to esstablish Snowflake connection\n\nHere's an example usage of the SnowflakeReader.\n\n```python\nfrom llama_index import download_loader\n\nSnowflakeReader = download_loader(\"SnowflakeReader\")\n\nreader = SnowflakeReader(\n account=\"your_account\",\n user=\"your_user\",\n password=\"your_password\",\n database=\"your_database\",\n schema=\"your_schema\",\n warehouse=\"your_warehouse\",\n role=\"your_role\", # Optional role setting\n proxy=\"http://proxusername:proxypassword@myproxy:port\", # Optional proxy setting\n)\n\nquery = \"SELECT * FROM your_table\"\n\ndocuments = reader.load_data(query=query)\n```\n\n#### Author\n\n[Godwin Paul Vincent](https://github.com/godwin3737)\n\nThis loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent. See [here](https://github.com/emptycrown/llama-hub/tree/main) for examples.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index readers snowflake integration",
"version": "0.1.3",
"project_urls": null,
"split_keywords": [
"data warehouse",
"database",
"snowflake",
"warehouse"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "72849aa79665a0c13a74f1f404a2125537a98e9966fad1aaa48d26a38175030c",
"md5": "6ced7d108328b756830c01e5440f4fb0",
"sha256": "12cb73b17acc8704265b098c76b4662d6b1fa2330a7c7e923ee680ccdcaf8b83"
},
"downloads": -1,
"filename": "llama_index_readers_snowflake-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6ced7d108328b756830c01e5440f4fb0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0",
"size": 3606,
"upload_time": "2024-02-21T20:53:06",
"upload_time_iso_8601": "2024-02-21T20:53:06.823159Z",
"url": "https://files.pythonhosted.org/packages/72/84/9aa79665a0c13a74f1f404a2125537a98e9966fad1aaa48d26a38175030c/llama_index_readers_snowflake-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2d44623f83e38fee89e93b04cad9df4d3883694e3c565a705ce253d6a5547eac",
"md5": "fa847dc48c362f28cfd83fef31fcceef",
"sha256": "cc3a491034ab55adccd78ee920df2741678f1d7dfbfd784f88462d85325f535e"
},
"downloads": -1,
"filename": "llama_index_readers_snowflake-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "fa847dc48c362f28cfd83fef31fcceef",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0",
"size": 3308,
"upload_time": "2024-02-21T20:53:12",
"upload_time_iso_8601": "2024-02-21T20:53:12.337759Z",
"url": "https://files.pythonhosted.org/packages/2d/44/623f83e38fee89e93b04cad9df4d3883694e3c565a705ce253d6a5547eac/llama_index_readers_snowflake-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-21 20:53:12",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-readers-snowflake"
}