LlamaIndex Node Parser Xberg
Structure-aware LlamaIndex node parser for xberg-extracted documents. It turns xberg's native chunks into nodes, and falls back to structural elements when chunks are absent.
Installation
pip install llama-index-node-parser-xberg
Requires llama-index-core>=0.14.23,<0.15. This package does not depend on
xberg directly — xberg is a dependency of the reader
(llama-index-readers-xberg), which produces the documents this parser splits.
Prerequisites
This parser requires documents with
_xberg_chunksor_xberg_elementsmetadata. These are produced byXbergReader. Prefer native chunking; use element-based extraction when you want one node per structural element. Documents carrying neither pass through unchanged with a warning.
from xberg import ChunkingConfig, ExtractionConfig
from llama_index.readers.xberg import XbergReader
# Preferred: native semantic chunks with heading path and page span.
reader = XbergReader(
extraction_config=ExtractionConfig(chunking=ChunkingConfig(max_characters=1000, overlap=200))
)
documents = reader.load_data("report.pdf")
Features
- Chunk-aware splitting — each xberg native chunk becomes a node, carrying
chunk_type,heading_path, and page span - Element fallback — when no chunks are present, headings, paragraphs, tables, and code blocks each become a node
- Source and prev/next relationships tracked via
NodeRelationship - Graceful degradation — documents without chunk or element metadata pass through with a warning
- Composes with other transformations (e.g.,
SentenceSplitter) - Async support via
aget_nodes_from_documents - Serialization support (
to_dict/from_dict)
Usage
Basic
Full reader-to-nodes flow:
from xberg import ChunkingConfig, ExtractionConfig
from llama_index.readers.xberg import XbergReader
from llama_index.node_parser.xberg import XbergNodeParser
reader = XbergReader(
extraction_config=ExtractionConfig(chunking=ChunkingConfig(max_characters=1000, overlap=200))
)
documents = reader.load_data("report.pdf")
parser = XbergNodeParser()
nodes = parser.get_nodes_from_documents(documents)
IngestionPipeline
Chain with SentenceSplitter to further split any oversized nodes:
from llama_index.core.ingestion import IngestionPipeline
from llama_index.core.node_parser import SentenceSplitter
pipeline = IngestionPipeline(
transformations=[
XbergNodeParser(),
SentenceSplitter(chunk_size=512), # Further split large nodes
]
)
nodes = pipeline.run(documents=documents)
VectorStoreIndex
Using the transformations parameter:
from llama_index.core import VectorStoreIndex
index = VectorStoreIndex.from_documents(
documents,
transformations=[XbergNodeParser()],
)
Async
nodes = await parser.aget_nodes_from_documents(documents)
Behavior Notes
- Chunks take priority over elements. When a document carries both
_xberg_chunksand_xberg_elements, the parser splits on chunks. - Documents without either metadata key pass through unchanged with a warning. This is intentional — silently falling back would hide that you are not getting structure-aware splitting.
- Empty or whitespace-only chunks and elements are automatically skipped.
Metadata
Release files for llama-index-node-parser-xberg 1.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_node_parser_xberg-1.3.8.tar.gz | 8.4 kB | Without provenance | Details for llama_index_node_parser_xberg-1.3.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_node_parser_xberg-1.3.8-py3-none-any.whl | Python 3 | none | any | Details for llama_index_node_parser_xberg-1.3.8-py3-none-any.whl |
Total release size: 14.1 kB
Release files / llama_index_node_parser_xberg-1.3.8.tar.gz
| Download URL | llama_index_node_parser_xberg-1.3.8.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94e55298558d409f0b3d44049fc1d9ae8384342eb8c61b957ae873849cdb94e5
|
|
BLAKE2b-256 checksum How to use checksums |
21f873ff9dc3c014f792dd264fdf260ce78ddbcdba49816ca8e807645215207f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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}
|
Release files / llama_index_node_parser_xberg-1.3.8-py3-none-any.whl
| Download URL | llama_index_node_parser_xberg-1.3.8-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a46e700239999c226cab6e222f36f446e53566198c292c5357ee4e07d73ce32e
|
|
BLAKE2b-256 checksum How to use checksums |
cf2cfc122209ab2ea0565de20e56ab922b0d92e064361b8b7cb5d51a420559e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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}
|
Security for llama-index-node-parser-xberg 1.3.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.