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) to $2.90 (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), 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.0

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.0
File Size Uploaded Provenance Actions
lightrag_section_anything-0.1.0.tar.gz 14.7 kB With provenance Details for lightrag_section_anything-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 28.0 kB

Release files / lightrag_section_anything-0.1.0.tar.gz

Download URL lightrag_section_anything-0.1.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
80178bddabd7c5c7dda5da91838e95087bc4975a54076a3aef0813341362b03f
BLAKE2b-256 checksum
How to use checksums
b861cd96fa0734e8ef57fd1b80ba79b8907aa6f2386aa76bc9a76f9cd9046bf7
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 27, 2026.

Transparency log

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

Download URL lightrag_section_anything-0.1.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9acfbf16d33a4b45cf8c275f3ca2fa4f985f498a743e303dcfbfaa7c4e8cd52
BLAKE2b-256 checksum
How to use checksums
f13d91f066d17b950d9f0a518db0b93baa9bfba588580f291637440665317f0e
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 27, 2026.

Transparency log

Security for lightrag-section-anything 0.1.0

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.0.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 27, 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.0 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