Skip to main content

llama-index readers gcs integration

Project description

GCS File or Directory Loader

This loader parses any file stored on GCS, or the entire Bucket (with an optional prefix filter) if no particular file is specified. When initializing GCSReader, you may pass in your GCP Service Account Key. If none are found, the loader assumes they are stored in ~/.gcp/credentials.

All files are 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

To use this loader, you need to pass in the name of your GCS Bucket. After that, if you want to just parse a single file, pass in its key. Note that if the file is nested in a subdirectory, the key should contain that, so like subdirectory/input.txt.

Otherwise, you may specify a prefix if you only want to parse certain files in the Bucket, or a subdirectory. GCP Service Account Key credentials may either be passed in during initialization or stored locally (see above).

loader = GCSReader(
    bucket="scrabble-dictionary",
    key="dictionary.txt",
    service_account_key_json="[SERVICE_ACCOUNT_KEY_JSON]",
)
documents = loader.load_data()

This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent. See here for examples.

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_gcs-0.1.5.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_readers_gcs-0.1.5-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_gcs-0.1.5.tar.gz.

File metadata

  • Download URL: llama_index_readers_gcs-0.1.5.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.14 Linux/6.5.0-1016-azure

File hashes

Hashes for llama_index_readers_gcs-0.1.5.tar.gz
Algorithm Hash digest
SHA256 56b80ff594728996bc774841ee4e5177596fe07f9d6403281d987a487b35da9b
MD5 05582a2e67b83e852748daa46e54cc28
BLAKE2b-256 4f70e449bcdd8a0ecea8956cfa495b2f72f2df34e03fd823d06bd56c5904e6f9

See more details on using hashes here.

File details

Details for the file llama_index_readers_gcs-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_gcs-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3866f22b7c9ed4fc767e3a82d388b2faecafce94520c647047b8488c2344614e
MD5 90d7665c8e9c6b960f7cf5e4caa4985f
BLAKE2b-256 09359ede423fb37a9b7347c207edae735804f19fdf2da29341031590d7c5758c

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