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
- 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"))
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_readers_structured_data-0.4.1.tar.gz.
File metadata
- Download URL: llama_index_readers_structured_data-0.4.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e688d96fcf5945037e7fac36f2989d6d8598f114c6906892e6b5f2ec29bdf30
|
|
| MD5 |
2927e7ee32f8dba50417f363e992764b
|
|
| BLAKE2b-256 |
3c6d3d747598e67eadcc19045e6bd5fae7e6a56c3c20bfc0b2915c30124c2bdc
|
File details
Details for the file llama_index_readers_structured_data-0.4.1-py3-none-any.whl.
File metadata
- Download URL: llama_index_readers_structured_data-0.4.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db7c5aac75b4f9f932d01686c61a3e655ef030ff2fa4a86bec6f33e9da4c7b62
|
|
| MD5 |
639e7d99db35371e030defb2a2799d37
|
|
| BLAKE2b-256 |
29a6fba7394da8939d48f0dbb597f1276cbeb4cfe2dfc8e1d12727dfbf1c56ee
|