Skip to main content

llama-index readers opendal_reader integration

Project description

OpenDAL Loaders

pip install llama-index-readers-opendal

Base OpendalReader

This loader parses any file via Apache OpenDAL.

All files are temporarily downloaded locally and subsequently parsed with SimpleDirectoryReader. Hence, you may also specify a custom file_extractor, relying on any of the loaders in this library (or your own)!

Usage

OpendalReader can read data from any supported storage services including s3, azblob, gcs and so on.

from llama_index.readers.opendal import OpendalReader

loader = OpendalReader(
    scheme="s3",
    bucket="bucket",
    path="path/to/data/",
)
documents = loader.load_data()

We also provide Opendal[S3|Gcs|Azblob]Reader for convenience.


This loader is designed to be used as a way to load data into LlamaIndex.

Azblob Loader

This loader parses any file stored on Azblob.

All files are temporarily downloaded locally and subsequently parsed with SimpleDirectoryReader. Hence, you may also specify a custom file_extractor, relying on any of the loaders in this library (or your own)!

Azblob loader is based on OpendalReader.

Usage

from llama_index.readers.opendal import OpendalAzblobReader

loader = OpendalAzblobReader(
    container="container",
    path="path/to/data/",
    endpoint="[endpoint]",
    account_name="[account_name]",
    account_key="[account_key]",
)
documents = loader.load_data()

This loader is designed to be used as a way to load data into LlamaIndex.

Gcs Loader

This loader parses any file stored on Gcs.

All files are temporarily downloaded locally and subsequently parsed with SimpleDirectoryReader. Hence, you may also specify a custom file_extractor, relying on any of the loaders in this library (or your own)!

Gcs loader is based on OpendalReader.

Usage

from llama_index.readers.opendal import OpendalGcsReader

loader = OpendalGcsReader(
    bucket="bucket",
    path="path/to/data/",
    endpoint="[endpoint]",
    credentials="[credentials]",
)
documents = loader.load_data()

Note: if credentials is not provided, this loader to try to load from env.


This loader is designed to be used as a way to load data into LlamaIndex.

S3 Loader

This loader parses any file stored on S3. When initializing S3Reader, you may pass in your AWS Access Key. If none are found, the loader assumes they are stored in ~/.aws/credentials.

All files are temporarily downloaded locally and subsequently parsed with SimpleDirectoryReader. Hence, you may also specify a custom file_extractor, relying on any of the loaders in this library (or your own)!

S3 loader is based on OpendalReader.

Usage

loader = OpendalS3Reader(
    bucket="bucket",
    path="path/to/data/",
    access_key_id="[ACCESS_KEY_ID]",
    secret_access_key="[ACCESS_KEY_SECRET]",
)
documents = loader.load_data()

Note: if access_key_id or secret_access_key is not provided, this loader to try to load from env.

Possible arguments includes:

  • endpoint: Specify the endpoint of s3 service.
  • region: Specify the region of s3 service.

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

llama_index_readers_opendal_reader-0.4.1.tar.gz (5.5 kB view details)

Uploaded Source

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_opendal_reader-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_opendal_reader-0.4.1.tar.gz
Algorithm Hash digest
SHA256 b16826623c3fa79e6d6ec1eea5b3f2f85e27e2e7c1f10bfd9b8f3c28f0e4453d
MD5 d0e6b5114df64cb6c748607c69e8d685
BLAKE2b-256 a8818280315594ce853bc32f17f1ea3688f02ae17f1d86af0cbf40c96278a5bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_readers_opendal_reader-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 213ba48d922fb72bffe9a3332fbb9f0ba1087e2ccc5114e786fc29558e8cc716
MD5 ba4fd711cf32f2845eea7672cbf2e809
BLAKE2b-256 a87b61e75b25ab0ac7278674e01fdee21506d91629bd2f86b67d9b9fb61433e0

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