doclang
DocLang reference toolkit
What it is and what it does
DocLang is a reference implementation toolkit for a markup format designed specifically for AI and LLM workflows. It provides command-line tools and a Python API to validate documents against the DocLang specification and package them for consumption by language models. The format preserves document structure, semantics, layout, and geometry in a single unambiguous representation that maps cleanly to LLM tokens.
The toolkit depends on lxml for XML processing and typer for CLI construction. It supports validation via XSD and Schematron, and document packaging operations. The package targets Python 3.10 and later, with active development and a specification maintained in the project repository.
Use it for:
- Validate DocLang-formatted documents before feeding them to LLM or VLM pipelines to ensure structural correctness.
- Package structured documents for consumption by AI models while preserving layout and semantic information.
- Build document processing workflows that need to maintain both human readability and machine-parseable structure.
- Integrate DocLang validation into CI/CD pipelines for content quality assurance before model inference.
- Convert or normalize unstructured content into a standardized format for multimodal LLM applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
DocLang is a reference toolkit for validating and packaging documents in DocLang format, an AI-native markup designed to preserve structure and semantics while mapping cleanly to LLM tokens.
Yes. The package has low install friction, active maintenance, no known vulnerabilities, and a permissive license. It fills a specific niche—standardizing document representation for LLM/VLM workflows—with a clean CLI and Python API. Suitable for production use if you are working with DocLang-formatted content or building AI document pipelines.
Install
doclang on PyPI
pip
pip install doclanguv
uv add doclangpoetry
poetry add doclangInstalling doclang
Before you install
Low friction: pure Python wheel with only lxml and typer as runtime dependencies. Active maintenance with a release within the last 30 days and a live repository.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install "doclang[schematron-saxon]"
doclang validate -n my_document.dclg
doclang pack my_document.dclg
Requires Python 3.10 or later.
Verify before relying
- Whether the optional schematron-saxon extra is required for typical validation workflows or only for advanced use cases.
- Performance characteristics when validating large documents or batch processing many files.
- Maturity and stability guarantees given the first release was 2026-06-02.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — lxml, typer |
| Maintenance | actively maintained — 30 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,326,709/month — #3,138 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: doclang-0.7.3-py3-none-any.whl
Keywords: doclang, xml, validation, xsd, schematron, documents, llm
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
doclingDocling parses diverse document formats—PDF,…
permissive · top 5,000 on PyPI
pomlPOML is a markup language and Python SDK for…
unclear · top 15,000 on PyPI
skills-refValidates, parses, and generates…
permissive · top 15,000 on PyPI
toon-formatEncodes and decodes data structures using TOON…
permissive · top 15,000 on PyPI
factur-xGenerates, validates, and extracts Factur-X,…
permissive · top 15,000 on PyPI
xmlschemaValidates XML documents against XSD schemas and…
permissive · top 5,000 on PyPI
langextractLangExtract uses LLMs to extract and ground…
permissive · top 15,000 on PyPI
lxmllxml provides Python bindings to libxml2 and…
permissive · top 1,000 on PyPI
turbohtmlParse, query, edit, and serialize HTML and XML…
permissive · top 15,000 on PyPI
tree-sitter-xmlProvides a tree-sitter parser grammar for XML…
permissive · top 5,000 on PyPI