harper-py
Python bindings for Harper, Automattic's offline English grammar checker written in Rust: grammar, spelling and style in milliseconds, in process, with no Java and no server. Unofficial; the API is the official harper.js one, in snake_case.
pip install harper-py
from harper import Linter
linter = Linter() # build once and reuse: construction loads the dictionary
text = "This is an test of the the linter."
for lint in linter.lint(text):
print(f"{lint.span.start}: {lint.problem_text!r} {lint.message}")
print(" ", linter.apply_suggestion(text, lint, lint.suggestions[0]))
8: 'an' Incorrect indefinite article.
This is a test of the the linter.
19: 'the the' Did you mean to repeat this word?
This is an test of the linter.
Spans are str indices, so text[lint.span.start:lint.span.end] is always the flagged
text, emoji included. Markdown (the default), plain text and Typst are understood;
dialects, rule configuration, a user dictionary, ignored lints and Weirpacks work as in
harper.js. The guide
has the tour.
Why not language-tool-python
| harper-py | language-tool-python | |
|---|---|---|
| Runtime | none, the wheel is self-contained | Java ≥ 17 and a local LanguageTool server it starts |
| Download | 9.7–10.4 MB wheel, depending on the platform | a 60 kB wheel, then the LanguageTool 6.8 zip (259 MB) on first use |
| Cold start | 0.23 s: import harper + Linter() in a fresh process |
starts a JVM server (not measured: no Java on this machine) |
| Lint 1007 words | 23 ms (first call in a process: 95 ms) | — |
Measured on an Apple M4 Mac mini, CPython 3.11, with benchmarks/bench.py. LanguageTool
has far more rules and languages; Harper is the choice when you want English checking that
starts fast and ships as a plain dependency.
Platforms
Wheels for Linux (glibc and musl; x86_64, aarch64), macOS (arm64, x86_64) and Windows (x64, arm64); one abi3 wheel per platform covers CPython 3.10 and later. Building the sdist needs a Rust toolchain.
Same as harper.js
Linter is harper.js's Linter interface, synchronous: organizedLints →
organized_lints, getLintConfig → get_lint_config, LintOptions → keyword
arguments. Harper inside is 2.11.0 (harper-core, harper-stats, harper-typst
from crates.io), with harper-wasm's features. Lints are checked against harper-cli of
the same version on a 52-document corpus, and harper.js's own test suite is ported.
Every difference is listed in
DEVIATIONS.md.
License
Apache-2.0, like Harper. The binding layer is ported from Harper's harper-wasm.
Metadata
Release files for harper-py 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 | |
|---|---|---|---|
| harper_py-0.1.0.tar.gz | 78.5 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| harper_py-0.1.0-cp310-abi3-win_arm64.whl | CPython 3.10 | abi3 | Windows ARM64 | Details |
| harper_py-0.1.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| harper_py-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ x86-64 | Details |
| harper_py-0.1.0-cp310-abi3-musllinux_1_2_aarch64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ ARM64 | Details |
| harper_py-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| harper_py-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| harper_py-0.1.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| harper_py-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 80.6 MB
Release files / harper_py-0.1.0.tar.gz
| Download URL | harper_py-0.1.0.tar.gz |
|---|---|
| Size | 78.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbfc63b3d86b27ee985c29569c6887f3d06f46f75c7e948f2931dedf9895222f
|
|
BLAKE2b-256 checksum How to use checksums |
e9c9d063d027b23d4908941a6db22bb6d51b1287ea9172f5efc819e21d7845da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 11, 2026.
Transparency logRelease files / harper_py-0.1.0-cp310-abi3-win_arm64.whl
| Download URL | harper_py-0.1.0-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 9.9 MB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
efabe1749e2dafef85a1740fe5219f42b969ebb72163b76b81180804dc6a3d4b
|
|
BLAKE2b-256 checksum How to use checksums |
7bc93e30b7231d760d2f912d4cede370c9d5af9c19f1eb8c3e452a2ac20702cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 11, 2026.
Transparency logRelease files / harper_py-0.1.0-cp310-abi3-win_amd64.whl
| Download URL | harper_py-0.1.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 10.4 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1f7d57ec94621285e44781410bbf23db5afc3fdc21d45f644d6ed71ea74f4534
|
|
BLAKE2b-256 checksum How to use checksums |
eee225602b64715d18c5e6f452fd8369c0dcc8cd2a7ec59b78095148947b6b18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 11, 2026.
Transparency logRelease files / harper_py-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | harper_py-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 10.4 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c4038690572670a37687481fad9511f8b1fcab2cfc87f22d103c9b6adab4dca5
|
|
BLAKE2b-256 checksum How to use checksums |
2eab6118dd5301c1b52e48770d8b8fdcda8ac2f1cddff2ff547b1bb39989f94b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 11, 2026.
Transparency logRelease files / harper_py-0.1.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | harper_py-0.1.0-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 10.0 MB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
9f989372a7494ab74bff4b3b3cf0f70bfa8fdc43f76a05404218d2d04e2d1b65
|
|
BLAKE2b-256 checksum How to use checksums |
1be7c9d5ed744d1c7b881997e8c8e20f347c4b3f8cb6d8a25e145813334ea12f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 11, 2026.
Transparency logRelease files / harper_py-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | harper_py-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 10.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b90d2a4422f64bb1582509a1da61942bd3da709f2a6eeb6d80a6ae615093fa6d
|
|
BLAKE2b-256 checksum How to use checksums |
0212ee9142e837eac15867ee58d8d9e77a7e5e02955044f36ef807e84e781876
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 11, 2026.
Transparency logRelease files / harper_py-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | harper_py-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 9.8 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
e3646132c65dfe38ccb01470af90b622d7c48a8266403b9451481fd8ccd94919
|
|
BLAKE2b-256 checksum How to use checksums |
06dc278ac1c68ca956eb6ed5464f8467ef9e9fe7c74cf0f67508df85a20dfa03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 11, 2026.
Transparency logRelease files / harper_py-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | harper_py-0.1.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 9.8 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9fabd5e7f4f5b5ba3f3f1560f51fbaa82641dcc5949620f6f1710b7e964357a4
|
|
BLAKE2b-256 checksum How to use checksums |
27b082a2dd8f903c70af58aff6cf1205b875a9135c800ea1f191d685402e155d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 11, 2026.
Transparency logRelease files / harper_py-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | harper_py-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 10.0 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
16582f8aa87d2bcbe43757cf759657c8046eaede27150ddfb04e5219e69c6acb
|
|
BLAKE2b-256 checksum How to use checksums |
1e1df08c66cc288587983bea93ec2b8c396674cc979289f5e16383c04bdddd1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 11, 2026.
Transparency log