Skip to main content

llama-index readers structured_data integration

Project description

LlamaIndex Readers Integration: Structured-Data

The function 'StructuredDataReader' supports reading files in JSON, JSONL, CSV, and XLSX formats. It provides parameters 'col_index' and 'col_metadata' to differentiate between columns that should be written into the document's main text and additional metadata.

Install package

pip install llama-index-readers-structured-data

Or install locally:

pip install -e llama-index-integrations/readers/llama-index-readers-structured-data

Usage

  1. for single document:
from pathlib import Path
from llama_index.readers.structured_data.base import StructuredDataReader

parser = StructuredDataReader(col_index=["col1", "col2"], col_metadata=0)
documents = parser.load_data(Path("your/file/path.json"))
  1. for dictory of documents:
from pathlib import Path
from llama_index.core import SimpleDirectoryReader
from llama_index.readers.structured_data.base import StructuredDataReader

parser = StructuredDataReader(col_index=[1, -1], col_metadata="col3")
file_extractor = {
    ".xlsx": parser,
    ".csv": parser,
    ".json": parser,
    ".jsonl": parser,
}
documents = SimpleDirectoryReader(
    "your/dic/path", file_extractor=file_extractor
).load_data()

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_structured_data-0.5.0.tar.gz (4.8 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_structured_data-0.5.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_structured_data-0.5.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}

File hashes

Hashes for llama_index_readers_structured_data-0.5.0.tar.gz
Algorithm Hash digest
SHA256 994451634427205b089ab0e95301c37b2f52a57db2e914eca0d84879b8816728
MD5 ee24651496056a6e3ee731fca4dc3107
BLAKE2b-256 25a9a79cba85bd1c4a4e4674bb67b1c4a571078e2094e6f80a4bf13c28f1812a

See more details on using hashes here.

File details

Details for the file llama_index_readers_structured_data-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_readers_structured_data-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}

File hashes

Hashes for llama_index_readers_structured_data-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f10b0c322d69a74337e168676df7847afed136420edd97ce864b672a8525f7f
MD5 7a5490e9d88b445282bafa6d7f0e4b11
BLAKE2b-256 d4b80eec5b109d14237eaefe5b640bdfb52314c1f00c46f60064e38c3d38b7b8

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