Skip to main content

lightrag-section-anything

LightRAG parser engines that turn a PDF into heading-aware blocks (.blocks.jsonl) using the section-anything library, so LightRAG's heading-based chunker ("P") and its heading context work on PDFs without a MinerU or Docling service.

Install

pip install lightrag-section-anything
# latest from GitHub:
pip install "git+https://github.com/Omniwot/section-anything#subdirectory=packages/lightrag-section-anything"

Python 3.11+. Depends on section-anything and lightrag-hku (1.5.7 or later, below 1.7); the LightRAG server needs lightrag-hku[api]. The engines register through LightRAG's lightrag.parsers entry point, which the LightRAG server (lightrag-server) and the parser debug CLI (python -m lightrag.parser.cli) load at startup. When you embed LightRAG as a library, call load_third_party_parsers() from lightrag.parser.plugins first.

Engines

Engine Runs Cost per 1,000 pages
sectionany_free rules (bookmarks, contents, typography) $0
sectionany_quick rules + a small model reviewing candidate lines about $0.07
sectionany_standard a model reading all lines about $0.16 (gpt-6-luna, the default); $2.90 with gpt-6.1-sol
sectionany_local quick-style review on a local Ollama model (SECTIONANY_LOCAL_MODEL) $0
sectionany the mode in SECTIONANY_MODE (default free)

Use

Route PDFs to an engine with LightRAG's LIGHTRAG_PARSER rules, for example:

LIGHTRAG_PARSER=pdf:sectionany_quick-P,pdf:sectionany-P,*:native-teP,*:legacy-R

Settings are the library's SECTIONANY_* environment variables (see its README): API key (SECTIONANY_API_KEY, else OPENAI_API_KEY for OpenAI's endpoint or ANTHROPIC_API_KEY for Claude models), models, prices, SECTIONANY_MAX_USD_PER_DOC (default 0.50), SECTIONANY_OVER_BUDGET=downgrade|fail, SECTIONANY_MAX_PAGES (500), SECTIONANY_MAX_MB (100), SECTIONANY_EXTRACT_TIMEOUT_SECONDS (120). The plugin adds SECTIONANY_MODE, SECTIONANY_SYNTHETIC_TITLES and MAX_PARALLEL_PARSE_SECTIONANY (default 2). Nothing is written to the process environment, so LightRAG's own model settings are untouched. Cost, model and mode per document are reported in LightRAG's document status (parse_warnings) and in <name>.sectionany.json.

Tests: SECTIONANY_TEST_PDF=<some.pdf> pytest packages/lightrag-section-anything/tests.

Not yet: tables as tables, images, OCR, re-levelling MinerU/Docling output, a section-path prefix inside embeddings (needs LightRAG's chunker plugins, 1.5.8+).

Metadata

Release files for lightrag-section-anything 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lightrag-section-anything 0.1.1
File Size Uploaded Provenance Actions
lightrag_section_anything-0.1.1.tar.gz 14.9 kB With provenance Details for lightrag_section_anything-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lightrag-section-anything 0.1.1
File Interpreter ABI Platform Actions
lightrag_section_anything-0.1.1-py3-none-any.whl Python 3 none any Details for lightrag_section_anything-0.1.1-py3-none-any.whl

Total release size: 28.3 kB

Release files / lightrag_section_anything-0.1.1.tar.gz

Download URL lightrag_section_anything-0.1.1.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
94892eb808b1e1df03a51ae30c4756685a3405d386d6ab7b68b8a3ceb863c5fb
BLAKE2b-256 checksum
How to use checksums
1a77e57404c53b3fa740602704c32c652e5ae462526ddacac5e297f0000afdac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / lightrag_section_anything-0.1.1-py3-none-any.whl

Download URL lightrag_section_anything-0.1.1-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00918e25b84eb3c429d43f97b3cce92a2f307bd0eb7f4975a8641e88e648c63d
BLAKE2b-256 checksum
How to use checksums
b4054135601f5a600f67c2a28f166c4a3c8fd178fd332ece2f19e81d4ac7cabb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for lightrag-section-anything 0.1.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lightrag_section_anything-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page