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

Built Distribution

File details

Details for the file llama_index_readers_opendal_reader-0.3.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_opendal_reader-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d5b8fde312c1d4169ebe41fa8d11da8070d5bb4e38cf570115f0737d00e36fe4
MD5 f8bb38de5adfc47ca619c9faa23c1ebb
BLAKE2b-256 a0e1b2f14af24b1e21e4c1b74418fc1b3f452844ac21f590cff23d5a26d878c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_readers_opendal_reader-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 009e092c414cdbafc1fa5d79b0e6b6c43ae70ad3f2b4184247001432f1f5dbd5
MD5 bf8aa44a395a3f85fd68df3b0689896b
BLAKE2b-256 5c434e268f4295b96962f03b75b3f50e321320201aa731b840b2f58f4b7dac52

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