Skip to main content

LlamaIndex Readers Integration: Document360

The Document360Reader class is a custom reader that interacts with the Document360 API to fetch articles. It processes these articles recursively and allows further handling via custom callback functions, while also handling rate limiting and errors.

Installation

pip install llama-index-readers-document360

Usage

from document360_reader import Document360Reader

reader = Document360Reader(api_key="your_api_key")

# Load data
documents = reader.load_data()

# Use the documents as needed
for doc in documents:
    print(doc.text)

Class Initialization

def __init__(
    self,
    api_key: str,
    should_process_project_version=None,
    should_process_category=None,
    should_process_article=None,
    handle_batch_finished=None,
    handle_rate_limit_error=None,
    handle_request_http_error=None,
    handle_category_processing_started=None,
    handle_article_processing_started=None,
    handle_article_processing_error=None,
    handle_load_data_error=None,
    article_to_custom_document=None,
    rate_limit_num_retries=10,
    rate_limit_retry_wait_time=30,
):
    pass

api_key: Your Document360 API key (required). should_process_project_version: Callback to determine whether to process a project version. should_process_category: Callback to determine whether to process a category. should_process_article: Callback to determine whether to process an article. handle_batch_finished: Callback executed after all articles are processed. handle_rate_limit_error: Callback for handling rate limit errors. handle_request_http_error: Callback for handling HTTP errors. handle_category_processing_started: Callback triggered when category processing starts. handle_article_processing_started: Callback triggered when article processing starts. handle_article_processing_error: Callback for handling errors during article processing. handle_load_data_error: Callback for handling errors during data loading. article_to_custom_document: Custom transformation function to map an article to a document. rate_limit_num_retries: Number of retry attempts when hitting rate limits. rate_limit_retry_wait_time: Time to wait (in seconds) between retries after a rate limit error.

Referencing entities

from llama_index.readers.document360.entities import (
    Article,
    ArticleSlim,
    Category,
    ProjectVersion,
)


def handle_category_processing_started(category: Category):
    logging.info(f"Started processing category: {category}")


def handle_article_processing_started(article: Article):
    logging.info(f"Processing article: {article}")

All the fields in the entities are marked as Optional. This is because the actual API responses from Document360 sometimes do not match the expected schema mentioned in the API documentation.

Referencing errors

from llama_index.readers.document360.errors import (
    RetryError,
    HTTPError,
    RateLimitException,
)

reader = Document360Reader(api_key="your_api_key")

try:
    reader.load_data()
except RetryError as e:
    logging.info(f"Retry Error: {e}")

Metadata

Release files for llama-index-readers-document360 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-readers-document360 0.5.0
File Size Uploaded Provenance Actions
llama_index_readers_document360-0.5.0.tar.gz 6.9 kB Without provenance Details for llama_index_readers_document360-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-readers-document360 0.5.0
File Interpreter ABI Platform Actions
llama_index_readers_document360-0.5.0-py3-none-any.whl Python 3 none any Details for llama_index_readers_document360-0.5.0-py3-none-any.whl

Total release size: 15.5 kB

Release files / llama_index_readers_document360-0.5.0.tar.gz

Download URL llama_index_readers_document360-0.5.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c121f463344fec491e230dd10a0cd13bb1bb115b4e765607ca6cc4262cc671a0
BLAKE2b-256 checksum
How to use checksums
249c2c261f0a5a9a715c0fb0acfe9b20026b8cc3edba691285ce43ff20fa4cc6
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_document360-0.5.0-py3-none-any.whl

Download URL llama_index_readers_document360-0.5.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cffd45c4b0450a60be8c44b81f88c22a9a9c8af25305aef8450bbfd75201871d
BLAKE2b-256 checksum
How to use checksums
11b06841d8c0264d1b7246e94388b952c7c6990d521bb47a9888b2b9324b3b87
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-document360 0.5.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page