Name | llama-index-readers-airbyte-shopify JSON |
Version |
0.2.0
JSON |
| download |
home_page | None |
Summary | llama-index readers airbyte_shopify integration |
upload_time | 2024-08-22 14:19:43 |
maintainer | flash1293 |
docs_url | None |
author | Your Name |
requires_python | <4.0,>=3.8.1 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Airbyte Shopify Loader
```bash
pip install llama-index-readers-airbyte-shopify
```
The Airbyte Shopify Loader allows you to access different Shopify objects.
## Usage
Here's an example usage of the AirbyteShopifyReader.
```python
from llama_index.readers.airbyte_shopify import AirbyteShopifyReader
shopify_config = {
# ...
}
reader = AirbyteShopifyReader(config=shopify_config)
documents = reader.load_data(stream_name="orders")
```
## Configuration
Check out the [Airbyte documentation page](https://docs.airbyte.com/integrations/sources/shopify/) for details about how to configure the reader.
The JSON schema the config object should adhere to can be found on Github: [https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-shopify/source_shopify/spec.json](https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-shopify/source_shopify/spec.json).
The general shape looks like this:
```python
{
"start_date": "<date from which to start retrieving records from in ISO format, e.g. 2020-10-20T00:00:00Z>",
"shop": "<name of the shop you want to retrieve documents from>",
"credentials": {
"auth_method": "api_password",
"api_password": "<your api password>",
},
}
```
By default all fields are stored as metadata in the documents and the text is set to the JSON representation of all the fields. Construct the text of the document by passing a `record_handler` to the reader:
```python
def handle_record(record, id):
return Document(
doc_id=id, text=record.data["title"], extra_info=record.data
)
reader = AirbyteShopifyReader(
config=shopify_config, record_handler=handle_record
)
```
## Lazy loads
The `reader.load_data` endpoint will collect all documents and return them as a list. If there are a large number of documents, this can cause issues. By using `reader.lazy_load_data` instead, an iterator is returned which can be consumed document by document without the need to keep all documents in memory.
## Incremental loads
This loader supports loading data incrementally (only returning documents that weren't loaded last time or got updated in the meantime):
```python
reader = AirbyteShopifyReader(config={...})
documents = reader.load_data(stream_name="orders")
current_state = reader.last_state # can be pickled away or stored otherwise
updated_documents = reader.load_data(
stream_name="orders", state=current_state
) # only loads documents that were updated since last time
```
This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-readers-airbyte-shopify",
"maintainer": "flash1293",
"docs_url": null,
"requires_python": "<4.0,>=3.8.1",
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/f9/04/33829c4fa6cca18999e036c7b2811879fef9d4bf73a2ebe8bbea095c986b/llama_index_readers_airbyte_shopify-0.2.0.tar.gz",
"platform": null,
"description": "# Airbyte Shopify Loader\n\n```bash\npip install llama-index-readers-airbyte-shopify\n```\n\nThe Airbyte Shopify Loader allows you to access different Shopify objects.\n\n## Usage\n\nHere's an example usage of the AirbyteShopifyReader.\n\n```python\nfrom llama_index.readers.airbyte_shopify import AirbyteShopifyReader\n\nshopify_config = {\n # ...\n}\nreader = AirbyteShopifyReader(config=shopify_config)\ndocuments = reader.load_data(stream_name=\"orders\")\n```\n\n## Configuration\n\nCheck out the [Airbyte documentation page](https://docs.airbyte.com/integrations/sources/shopify/) for details about how to configure the reader.\nThe JSON schema the config object should adhere to can be found on Github: [https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-shopify/source_shopify/spec.json](https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-shopify/source_shopify/spec.json).\n\nThe general shape looks like this:\n\n```python\n{\n \"start_date\": \"<date from which to start retrieving records from in ISO format, e.g. 2020-10-20T00:00:00Z>\",\n \"shop\": \"<name of the shop you want to retrieve documents from>\",\n \"credentials\": {\n \"auth_method\": \"api_password\",\n \"api_password\": \"<your api password>\",\n },\n}\n```\n\nBy default all fields are stored as metadata in the documents and the text is set to the JSON representation of all the fields. Construct the text of the document by passing a `record_handler` to the reader:\n\n```python\ndef handle_record(record, id):\n return Document(\n doc_id=id, text=record.data[\"title\"], extra_info=record.data\n )\n\n\nreader = AirbyteShopifyReader(\n config=shopify_config, record_handler=handle_record\n)\n```\n\n## Lazy loads\n\nThe `reader.load_data` endpoint will collect all documents and return them as a list. If there are a large number of documents, this can cause issues. By using `reader.lazy_load_data` instead, an iterator is returned which can be consumed document by document without the need to keep all documents in memory.\n\n## Incremental loads\n\nThis loader supports loading data incrementally (only returning documents that weren't loaded last time or got updated in the meantime):\n\n```python\nreader = AirbyteShopifyReader(config={...})\ndocuments = reader.load_data(stream_name=\"orders\")\ncurrent_state = reader.last_state # can be pickled away or stored otherwise\n\nupdated_documents = reader.load_data(\n stream_name=\"orders\", state=current_state\n) # only loads documents that were updated since last time\n```\n\nThis loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index readers airbyte_shopify integration",
"version": "0.2.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "11bbb1b35744ef5e4322a53978a1bb49a759a2ae6f3a9efbff72a756dc9b7062",
"md5": "7de55cbefd51b16deb4a98f9bd9ec2e0",
"sha256": "686c51294e0f1c003cd2580ad220beee7cde4eb60bae7f087563d250d1a2d16b"
},
"downloads": -1,
"filename": "llama_index_readers_airbyte_shopify-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7de55cbefd51b16deb4a98f9bd9ec2e0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8.1",
"size": 3097,
"upload_time": "2024-08-22T14:19:42",
"upload_time_iso_8601": "2024-08-22T14:19:42.772429Z",
"url": "https://files.pythonhosted.org/packages/11/bb/b1b35744ef5e4322a53978a1bb49a759a2ae6f3a9efbff72a756dc9b7062/llama_index_readers_airbyte_shopify-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f90433829c4fa6cca18999e036c7b2811879fef9d4bf73a2ebe8bbea095c986b",
"md5": "5632bd6f42a9c38899c4af1327d1e00e",
"sha256": "7c06ceeba8a3108a13114b9790e208fde66964d2304f294f637899358d315277"
},
"downloads": -1,
"filename": "llama_index_readers_airbyte_shopify-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "5632bd6f42a9c38899c4af1327d1e00e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8.1",
"size": 2790,
"upload_time": "2024-08-22T14:19:43",
"upload_time_iso_8601": "2024-08-22T14:19:43.678913Z",
"url": "https://files.pythonhosted.org/packages/f9/04/33829c4fa6cca18999e036c7b2811879fef9d4bf73a2ebe8bbea095c986b/llama_index_readers_airbyte_shopify-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-22 14:19:43",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-readers-airbyte-shopify"
}