Skip to main content

harper-py

PyPI Python versions CI License

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for harper-py 0.1.1
File Size Uploaded
harper_py-0.1.1.tar.gz 78.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for harper-py 0.1.1
File
harper_py-0.1.1-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details
harper_py-0.1.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
harper_py-0.1.1-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
harper_py-0.1.1-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details
harper_py-0.1.1-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.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
harper_py-0.1.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
harper_py-0.1.1-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.1.tar.gz

Download URL harper_py-0.1.1.tar.gz
Size 78.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3ba5a08a35d02639503b04297c76947f7f4d2c84cee4eb249706247cac12c72b
BLAKE2b-256 checksum
How to use checksums
847ca07d001b4fdebd218dccf4a258844592d446ced4451ec6a432160efff7a5
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 13, 2026.

Transparency log

Release files / harper_py-0.1.1-cp310-abi3-win_arm64.whl

Download URL harper_py-0.1.1-cp310-abi3-win_arm64.whl
Size 9.9 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
c3f48a6ad2ae814ffda948e0dfbeaaf9bdf001ad87e64e53fe941eca3055fafb
BLAKE2b-256 checksum
How to use checksums
d4dcc444c58e0b87ef6c011c2f90aadd48f41be41fb8c3a86f7d5b6da2d866ac
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 13, 2026.

Transparency log

Release files / harper_py-0.1.1-cp310-abi3-win_amd64.whl

Download URL harper_py-0.1.1-cp310-abi3-win_amd64.whl
Size 10.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
88b913ba7c42898f7f8db65c8fb0eabf68d91ae7f316644b7051dab7365fb843
BLAKE2b-256 checksum
How to use checksums
3221994bbe26971bf694896b31b85f2d4b238a0f7f7800e6a33cc6eae1443f57
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 13, 2026.

Transparency log

Release files / harper_py-0.1.1-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL harper_py-0.1.1-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
8c454829194857c482d869c20a5f5672d76b4fc469e62497fb7153a98c8c5970
BLAKE2b-256 checksum
How to use checksums
16ef61f441f5f631497b5b9f6a56917f61af920d239a85578088b9656f956407
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 13, 2026.

Transparency log

Release files / harper_py-0.1.1-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL harper_py-0.1.1-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
3c71633130b6bddccd08c4e84a62416d534b2ed493cd2d5e0e4391fc2ffdfc01
BLAKE2b-256 checksum
How to use checksums
d6b845e303c4cc9b34e128b9a6869157bc0209f1531152a719f00a7d8a98bad0
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 13, 2026.

Transparency log

Release files / harper_py-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL harper_py-0.1.1-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
660ed5062be0fca6fa8bf43e88ea00595bbde358620560a82ac1362703a83709
BLAKE2b-256 checksum
How to use checksums
e4d8b1bc960c0a5759369cc37863b6a0737405e77cc202180297170ad0f1ef43
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 13, 2026.

Transparency log

Release files / harper_py-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL harper_py-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 9.9 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2c03132161d2f2beef2130598e5ca7cdcecc431300d9c8644cf98366d3723a98
BLAKE2b-256 checksum
How to use checksums
05f6c96ca16d6d4a0276fd87fa4772808ef31254b0cadb28115fcdc623d4061e
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 13, 2026.

Transparency log

Release files / harper_py-0.1.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL harper_py-0.1.1-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
754c4d06a7afbe8acf5bb4b8c5e3fd320fe77b0b3ec1cb3ebfc8184537320077
BLAKE2b-256 checksum
How to use checksums
c1d97ad7afa9ee19ddebf34b7e344bc69ab2725f7b752ee3bf9ecd48bac82d6e
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 13, 2026.

Transparency log

Release files / harper_py-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl

Download URL harper_py-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl
Size 9.9 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3309a79217a7d20badb942e9c783154dce072fb3f8e4b4da5a12334409ab82be
BLAKE2b-256 checksum
How to use checksums
16f313f1189bda11f2ad87299d03fa9b0ca58a217d0c11480e7f844f3b2fe6ab
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 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

9 release files

0.1.0

9 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page