Skip to main content

llama-index readers airbyte_typeform integration

Project description

Airbyte Typeform Loader

pip install llama-index-readers-airbyte-typeform

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

Usage

Here's an example usage of the AirbyteTypeformReader.

from llama_index.readers.airbyte_typeform import AirbyteTypeformReader

typeform_config = {
    # ...
}
reader = AirbyteTypeformReader(config=typeform_config)
documents = reader.load_data(stream_name="forms")

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-typeform/source_typeform/spec.json.

The general shape looks like this:

{
    "credentials": {
        "auth_type": "Private Token",
        "access_token": "<your auth token>",
    },
    "start_date": "<date from which to start retrieving records from in ISO format, e.g. 2020-10-20T00:00:00Z>",
    "form_ids": [
        "<id of form to load records for>"
    ],  # if omitted, records from all forms will be loaded
}

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 = AirbyteTypeformReader(
    config=typeform_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 = AirbyteTypeformReader(config={...})
documents = reader.load_data(stream_name="forms")
current_state = reader.last_state  # can be pickled away or stored otherwise

updated_documents = reader.load_data(
    stream_name="forms", 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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_readers_airbyte_typeform-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_airbyte_typeform-0.4.1.tar.gz
Algorithm Hash digest
SHA256 cafe7a2cb48d2ab6980e8f96b1b4b75f5a4d0118a0305e665a28a3d2c09260bf
MD5 00ba24549869ca3c90ee68069986f7ee
BLAKE2b-256 7b8a785114e1d281f9909a1d0ffd3183f0a2837e87bbbe8ab5dc7a463af625c5

See more details on using hashes here.

File details

Details for the file llama_index_readers_airbyte_typeform-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_airbyte_typeform-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2bdd55d1f40903eaf99671aa354b0924f0312aad7d07dc0ae07cf3aad9f41562
MD5 ecee19002ab4cf5009e51b4a38e6aef2
BLAKE2b-256 dd3e4312fb4eaa76f3f93445f4b50c237a216fc7d57fc88f34bc87178825eb45

See more details on using hashes here.

Supported by

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