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.2.0.tar.gz
.
File metadata
- Download URL: llama_index_readers_opendal_reader-0.2.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07023aa06c86e83bc95f4813a2a9d17bab20e423ed54a1b09f04175af70b8307 |
|
MD5 | 2c639fffac49b0e7b1ec13bf59c94d59 |
|
BLAKE2b-256 | e4ebb47c5789d6cd7a090a7c2605acf2c55cacae93e73bf720395f82506d2180 |
File details
Details for the file llama_index_readers_opendal_reader-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_readers_opendal_reader-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85bc22b48efbc6021c32aff78f3b1faaa584537630a357870162dd587f9eefa5 |
|
MD5 | 6c53c866be64f275db616214a481e4ae |
|
BLAKE2b-256 | 70d4447ab9ca8457e3d38cc935953e3bd451c8ed61f58fcf7e7786ea97a7633f |