Grammar Orchestrator
Fast, offline long-paragraph grammar correction that combines the strengths of
harper-py and
nlprule.
- Fast and offline – both engines ship as self-contained Rust wheels; no Java, no server.
- Returns fixed text –
fix()gives you the corrected string directly. - Handles long paragraphs – sentence-aware chunking keeps each engine call reliable.
- Best of both – default to
nlpruleforcorrect()convenience and multilingual support, or opt intoharperfor maximum English speed. - Pure-Python meta-package – depends on the two pre-built engines; you never compile Rust.
Install
pip install pygrammar-fix
Quick start
from pygrammar_fix import GrammarFixer
fixer = GrammarFixer() # defaults: lang="en", prefer="nlprule"
fixed = fixer.fix("This is an test of the the linter.")
print(fixed)
# Structured suggestions without applying them:
for suggestion in fixer.suggest("She was not been here since Monday."):
print(suggestion["start"], suggestion["end"], suggestion["message"], suggestion["replacements"])
Engine selection
# Maximum speed on English (harper-py):
fixer = GrammarFixer(prefer="harper")
# German or Spanish (nlprule only):
fixer = GrammarFixer(lang="de")
Architecture
The package is a thin orchestrator, not a merged binding:
Adapters (_adapters.py) wrap harper-py and nlprule behind a common suggest/correct interface.
Chunker (_chunker.py) performs sentence-aware splitting so long paragraphs never go to an engine in one piece.
Orchestrator (GrammarFixer) handles engine selection, lazy loading, and the public fix() / suggest() API.
Metadata
Release files for pygrammar-fix 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygrammar_fix-0.1.0.tar.gz | 10.5 kB | With provenance | Details for pygrammar_fix-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygrammar_fix-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pygrammar_fix-0.1.0-py3-none-any.whl |
Total release size: 19.8 kB
Release files / pygrammar_fix-0.1.0.tar.gz
| Download URL | pygrammar_fix-0.1.0.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
183a13df201ebfe7eaf5751324ddf7c20097458ae2fe00c5821945d6a2ad8fb0
|
|
BLAKE2b-256 checksum How to use checksums |
80b586d9fd02dc95546776578e766ef02db2986d81b7ae3c0530496f68a25694
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 logRelease files / pygrammar_fix-0.1.0-py3-none-any.whl
| Download URL | pygrammar_fix-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe48da8bb7d61179f9f28c28d38dca95dd41142fd17da40cf101cd66d635250a
|
|
BLAKE2b-256 checksum How to use checksums |
d8948df848be71b279ea31d059247f7eb4ded1ca91717e890a3390f42234778c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 logSecurity for pygrammar-fix 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
Both files in this release have been uploaded with provenance metadata.
Attestation for pygrammar_fix-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 28, 2026.
Transparency logA 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.