braq
Structured text format with sections
What it is and what it does
Braq is a lightweight text format and parser designed around the idea that structured data can be organized into human-readable sections, each with a header in square brackets and a body of plain text. The library provides functions to parse Braq documents into dictionaries (mapping headers to bodies) and to render Section objects back into formatted text. It supports embedding dictionary data structures via the Paradict format within sections, making it suitable for config files, code documentation, and AI prompt construction.
The format is deliberately simple: a document consists of an optional unnamed section at the top, followed by named sections. Multiple sections with the same header are concatenated. The library has no external runtime dependencies, making it quick to install and integrate. It targets developers who want a middle ground between plain text and rigid structured formats like JSON or YAML, particularly for use cases where readability and human editability matter as much as machine parsing.
Use it for:
- Parse configuration files that mix human-readable help text with embedded dictionary data structures.
- Extract and organize docstrings from Python functions using custom section-based documentation formats.
- Construct structured AI prompts that interleave instructions, user input, and conversation history in readable sections.
- Build custom document formats for domain-specific applications by extending Braq's section abstraction.
- Store and retrieve multi-section documents where sections may repeat and their bodies concatenate automatically.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Braq is a Python library for parsing and rendering section-based human-readable documents where content is organized under square-bracket headers with plain-text bodies.
Yes, if you need a lightweight, dependency-free way to parse or generate section-based text documents. The format is simple and the library is stable. However, the project is dormant with minimal community activity, so consider it for self-contained use cases rather than as a foundation for a larger ecosystem. Not suitable if you require active maintenance or frequent updates.
Install
braq on PyPI
pip
pip install braquv
uv add braqpoetry
poetry add braqInstalling braq
Before you install
Installation is straightforward with no runtime dependencies. The project is dormant (last commit 2024-12-10, no activity for 612 days) but remains available and functional for its stated purpose.
License in practice
MIT license is permissive, allowing use in commercial and private projects with minimal restrictions.
Quickstart
pip install braq
import braq
text = """[section 1]
this is section 1"""
d = braq.parse(text)
print(d["section 1"])
Requires Python 3.5 or later.
Verify before relying
- Whether the library handles edge cases in nested or deeply indented structures reliably.
- Performance characteristics with very large documents or many sections.
- Community adoption and real-world usage patterns beyond the documented examples.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 612 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 125,472/month — #11,815 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: braq-0.0.12-py3-none-any.whl
Keywords: pyrustic
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
kvfReads and writes configuration files in KvF…
permissive · top 15,000 on PyPI
paradictParadict serializes and deserializes Python…
permissive · top 15,000 on PyPI
paragraphsProvides a single function that joins…
permissive · top 15,000 on PyPI
mail-parserParses raw email messages into structured…
permissive · top 5,000 on PyPI
dominateDominate is a Python library for writing HTML…
copyleft · top 5,000 on PyPI
sharedShared provides a simple file-based data…
permissive · top 15,000 on PyPI
numpydocA Sphinx extension that parses and renders…
permissive · top 5,000 on PyPI
readme-rendererSafely renders README files in Markdown,…
permissive · top 1,000 on PyPI
humanreadableParses human-readable time and bitrate strings…
permissive · top 15,000 on PyPI
quotequailIdentifies and separates quoted text from…
permissive · top 15,000 on PyPI