Name | llama-index-readers-airbyte-hubspot JSON |
Version |
0.1.3
JSON |
| download |
home_page | |
Summary | llama-index readers airbyte_hubspot integration |
upload_time | 2024-02-21 19:16:56 |
maintainer | flash1293 |
docs_url | None |
author | Your Name |
requires_python | >=3.8.1,<4.0 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Airbyte Hubspot Loader
The Airbyte Hubspot Loader allows you to access different Hubspot objects.
## Installation
- Install llama_hub: `pip install llama_hub`
- Install the hubspot source: `pip install airbyte-source-hubspot`
## Usage
Here's an example usage of the AirbyteHubspotReader.
```python
from llama_hub.airbyte_hubspot import AirbyteHubspotReader
hubspot_config = {
# ...
}
reader = AirbyteHubspotReader(config=hubspot_config)
documents = reader.load_data(stream_name="products")
```
## Configuration
Check out the [Airbyte documentation page](https://docs.airbyte.com/integrations/sources/hubspot/) 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-hubspot/source_hubspot/spec.yaml](https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-hubspot/source_hubspot/spec.yaml).
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>",
"credentials": {
"credentials_title": "Private App Credentials",
"access_token": "<access token of your private app>",
},
}
```
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 = AirbyteHubspotReader(
config=hubspot_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 = AirbyteHubspotReader(config={...})
documents = reader.load_data(stream_name="products")
current_state = reader.last_state # can be pickled away or stored otherwise
updated_documents = reader.load_data(
stream_name="products", 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/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-airbyte-hubspot",
"maintainer": "flash1293",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/59/8d/5bdb10395b4a69e41dfc37bf071b595d053273877555b0a9c0b36246b678/llama_index_readers_airbyte_hubspot-0.1.3.tar.gz",
"platform": null,
"description": "# Airbyte Hubspot Loader\n\nThe Airbyte Hubspot Loader allows you to access different Hubspot objects.\n\n## Installation\n\n- Install llama_hub: `pip install llama_hub`\n- Install the hubspot source: `pip install airbyte-source-hubspot`\n\n## Usage\n\nHere's an example usage of the AirbyteHubspotReader.\n\n```python\nfrom llama_hub.airbyte_hubspot import AirbyteHubspotReader\n\nhubspot_config = {\n # ...\n}\nreader = AirbyteHubspotReader(config=hubspot_config)\ndocuments = reader.load_data(stream_name=\"products\")\n```\n\n## Configuration\n\nCheck out the [Airbyte documentation page](https://docs.airbyte.com/integrations/sources/hubspot/) 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-hubspot/source_hubspot/spec.yaml](https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-hubspot/source_hubspot/spec.yaml).\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 \"credentials\": {\n \"credentials_title\": \"Private App Credentials\",\n \"access_token\": \"<access token of your private app>\",\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 = AirbyteHubspotReader(\n config=hubspot_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 = AirbyteHubspotReader(config={...})\ndocuments = reader.load_data(stream_name=\"products\")\ncurrent_state = reader.last_state # can be pickled away or stored otherwise\n\nupdated_documents = reader.load_data(\n stream_name=\"products\", 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/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 airbyte_hubspot integration",
"version": "0.1.3",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0d11e2d1659d2a5c5dd711c42153ce3fd143a22db5711a1a6d7d1ec92e491e95",
"md5": "9b7ee2f6d937a58f152d4cb14ea766a1",
"sha256": "e9ca5061b3d74e95c6273dbe1e76708a7690bb7ce48bf5601d1acca82cd060fa"
},
"downloads": -1,
"filename": "llama_index_readers_airbyte_hubspot-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9b7ee2f6d937a58f152d4cb14ea766a1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0",
"size": 3192,
"upload_time": "2024-02-21T19:16:55",
"upload_time_iso_8601": "2024-02-21T19:16:55.370476Z",
"url": "https://files.pythonhosted.org/packages/0d/11/e2d1659d2a5c5dd711c42153ce3fd143a22db5711a1a6d7d1ec92e491e95/llama_index_readers_airbyte_hubspot-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "598d5bdb10395b4a69e41dfc37bf071b595d053273877555b0a9c0b36246b678",
"md5": "53c697d7cc69460bd20b62b271609006",
"sha256": "35f7330735fbaefdf2e7760b0520e6f42e94db75e1330851292f745e23b69b2d"
},
"downloads": -1,
"filename": "llama_index_readers_airbyte_hubspot-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "53c697d7cc69460bd20b62b271609006",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0",
"size": 2883,
"upload_time": "2024-02-21T19:16:56",
"upload_time_iso_8601": "2024-02-21T19:16:56.997989Z",
"url": "https://files.pythonhosted.org/packages/59/8d/5bdb10395b4a69e41dfc37bf071b595d053273877555b0a9c0b36246b678/llama_index_readers_airbyte_hubspot-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-21 19:16:56",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-readers-airbyte-hubspot"
}