abnf
Parsers for ABNF grammars.
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, zero runtime dependencies, and low install friction. It solves a real problem—parsing RFC-defined text formats—with production-proven code and comprehensive built-in grammar coverage. The MIT license is permissive. Install it if you need to parse or validate structured text defined by RFCs or custom ABNF grammars.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- To parse wire data (bytes), decode with latin-1 first before passing to parse methods.
- Minimal friction: pure Python wheel, no runtime dependencies, tested on Python 3.10–3.14.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive); you can use, modify, and distribute this package freely with minimal restrictions.
last release 2026-08-12 (2 days) · last repo commit 2026-08-14 · 53 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,082,161 downloads/mo, #4,394 on PyPI
Alternatives
Verify before relying
pip install abnf
from abnf.grammars import rfc7232
node, offset = rfc7232.Rule("ETag").parse('W/"moof"', 0)
print(node.value) # 'W/"moof"'- Performance characteristics of the optional Rust backend relative to the pure Python implementation.
- Whether the 30+ bundled grammar modules cover all common RFC use cases or if custom grammar compilation is often needed.
What it is and what it does
abnf is a parser generator that turns ABNF grammar specifications into working parsers. It implements RFC 5234 and RFC 7405, the standards for ABNF syntax itself, and ships with ready-to-use grammar modules for 30+ common RFCs covering HTTP headers, email addresses, URIs, and similar structured text formats. The package has been in production use since its original deployment for HTTP header parsing in a web framework.
You use it by either loading one of the bundled RFC grammar modules and calling parse or parse_all on input strings, or by compiling your own ABNF rule inline using Rule.create(). The library works with code points (strings), not raw bytes; to parse wire data, you decode it with latin-1 first to preserve the byte-to-code-point mapping. An optional Rust backend is available for substantially faster parsing when needed.
Use it for
- Parse and validate HTTP headers (ETag, Content-Type, etc.) using the bundled RFC 7232, RFC 7230 grammars.
- Validate email addresses and other RFC 5322 message format data against standard ABNF rules.
- Extract structured data from URIs, hostnames, or other RFC-defined formats using built-in grammar modules.
- Compile and parse custom ABNF grammars for proprietary or domain-specific text formats.
- Validate wire protocol data by decoding bytes as latin-1 and parsing against RFC-based ABNF rules.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, zero runtime dependencies, and low install friction. It solves a real problem—parsing RFC-defined text formats—with production-proven code and comprehensive built-in grammar coverage. The MIT license is permissive. Install it if you need to parse or validate structured text defined by RFCs or custom ABNF grammars.
Install
abnf on PyPI
Before you install
Minimal friction: pure Python wheel, no runtime dependencies, tested on Python 3.10–3.14. Active maintenance with a release 2 days ago; last commit 2026-08-14.
Requires Python 3.10 or later. To parse wire data (bytes), decode with latin-1 first before passing to parse methods.
License in practice
MIT license (permissive); you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install abnf
from abnf.grammars import rfc7232
node, offset = rfc7232.Rule("ETag").parse('W/"moof"', 0)
print(node.value) # 'W/"moof"'
Verify before relying
- Performance characteristics of the optional Rust backend relative to the pure Python implementation.
- Whether the 30+ bundled grammar modules cover all common RFC use cases or if custom grammar compilation is often needed.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,082,161 / month, #4,394 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Code GeneratorsTopic :: Software Development :: Interpreters |
Evidence: abnf-2.7.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “ABNF parser generator”
- abnfGenerates parsers from ABNF grammars as specified in RFC 5234 and RFC…
- rfc3987-syntaxValidates that strings conform to the ABNF syntax rules defined in…
- rplyRPLY is a pure Python parser generator that creates lexers and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Code Generators packages
Proto Plus wraps protocol buffers to provide Python classes that behave like native Python types while maintaining protocol buffer serialization and schema validation.
Install it if you're working with protocol buffers in Python and want a more Pythonic interface, or if you're using Google Cloud libraries that depend on it.
Cython is a source code translator that compiles Python code to C, enabling optional static typing and direct C/C++ interoperability to generate efficient native extensions.
Install it if you need to optimize Python performance, wrap C/C++ libraries, or build fast native extensions.
Annotates Python abstract syntax trees with the positions of tokens and source code text, enabling tools to map AST nodes back to their originating code for refactoring, analysis, and transformation.
Beartype is a runtime type checker that validates Python type hints at function call time, catching type violations before they cause downstream bugs.
Install it if you want runtime type safety for your annotated code or need to validate type hints on third-party packages.
llvmlite provides a lightweight Python binding to LLVM's IR builder, optimizer, and JIT compiler APIs, enabling you to write JIT compilers and code generators without needing the full LLVM C++ API surface.
astor converts Python abstract syntax trees (ASTs) back to readable source code and provides tools for AST manipulation, inspection, and non-recursive tree traversal.
Install it if you need AST round-tripping or advanced tree inspection.
See also rfc3987-syntax · TatSu · pyang · tree-sitter-typescript · lark · textparser · pygmars · xgrammar · lark-parser · lark-js