WordLift Reader
pip install llama-index-readers-wordlift
The WordLift GraphQL Reader is a connector to fetch and transform data from a WordLift Knowledge Graph using your the WordLift Key. The connector provides a convenient way to load data from WordLift using a GraphQL query and transform it into a list of documents for further processing.
Usage
To use the WordLift GraphQL Reader, follow the steps below:
- Set up the necessary configuration options, such as the API endpoint, headers, query, fields, and configuration options (make sure you have with you the Wordlift Key).
- Create an instance of the
WordLiftLoaderclass, passing in the configuration options. - Use the
load_datamethod to fetch and transform the data. - Process the loaded documents as needed.
Here's an example of how to use the WordLift GraphQL Reader:
import json
from llama_index.core import VectorStoreIndex
from llama_index.core import Document
from langchain.llms import OpenAI
from llama_index.readers.wordlift import WordLiftLoader
# Set up the necessary configuration options
endpoint = "https://api.wordlift.io/graphql"
headers = {
"Authorization": "<YOUR_WORDLIFT_KEY>",
"Content-Type": "application/json",
}
query = """
# Your GraphQL query here
"""
fields = "<YOUR_FIELDS>"
config_options = {
"text_fields": ["<YOUR_TEXT_FIELDS>"],
"metadata_fields": ["<YOUR_METADATA_FIELDS>"],
}
# Create an instance of the WordLiftLoader
reader = WordLiftLoader(endpoint, headers, query, fields, config_options)
# Load the data
documents = reader.load_data()
# Convert the documents
converted_doc = []
for doc in documents:
converted_doc_id = json.dumps(doc.doc_id)
converted_doc.append(
Document(
text=doc.text,
doc_id=converted_doc_id,
embedding=doc.embedding,
doc_hash=doc.doc_hash,
extra_info=doc.extra_info,
)
)
# Create the index and query engine
index = VectorStoreIndex.from_documents(converted_doc)
query_engine = index.as_query_engine()
# Perform a query
result = query_engine.query("<YOUR_QUERY>")
# Process the result as needed
logging.info("Result: %s", result)
Metadata
Release files for llama-index-readers-wordlift 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_readers_wordlift-0.6.0.tar.gz | 6.4 kB | Without provenance | Details for llama_index_readers_wordlift-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_readers_wordlift-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for llama_index_readers_wordlift-0.6.0-py3-none-any.whl |
Total release size: 12.4 kB
Release files / llama_index_readers_wordlift-0.6.0.tar.gz
| Download URL | llama_index_readers_wordlift-0.6.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b16eb348fb4b4d332bf038950ee81c2df1cf909d0a692cf28c3e3a1e370f1efb
|
|
BLAKE2b-256 checksum How to use checksums |
a25c219e1b4fd57d2b628007226578c26476fcb70297beb32773ef5abd8ab9c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_index_readers_wordlift-0.6.0-py3-none-any.whl
| Download URL | llama_index_readers_wordlift-0.6.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9bac648a0fe13a52f7b071f77810fa00f7316ae5e66dacbbb88c06cf7b218013
|
|
BLAKE2b-256 checksum How to use checksums |
6bea36e8204335e153836c80e50256509c517ce1784683c513c71f849df949fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for llama-index-readers-wordlift 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.