Skip to main content

llama-index readers airbyte_hubspot integration

Project description

Airbyte Hubspot Loader

pip install llama-index-readers-airbyte-hubspot

The Airbyte Hubspot Loader allows you to access different Hubspot objects.

Usage

Here's an example usage of the AirbyteHubspotReader.

from llama_index.readers.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 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.

The general shape looks like this:

{
    "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:

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):

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.

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

Built Distribution

File details

Details for the file llama_index_readers_airbyte_hubspot-0.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_airbyte_hubspot-0.2.0.tar.gz
Algorithm Hash digest
SHA256 95b4c4417c1dbfd3e0f74ac18e38274d3f498e703ac507e371acbaa8eaddc3b0
MD5 bf432193c25fbf2d5d4a899a5748072b
BLAKE2b-256 47b239592d975cc507655380ba517b4b675c5953e30b03a26ebd6d06ee212e8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_readers_airbyte_hubspot-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16c02860082db86f277617dda3e421289366a5f9749b8f6698ffc3e92d9045bb
MD5 7127aa18adde1e2d350e2fa6eabdad1d
BLAKE2b-256 c24052c5f915841016c498dd58311c70fbecb1aef6fdf4287ab6e177168168bb

See more details on using hashes here.

Supported by

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