Skip to main content

Example usage

>>> import language_tool
>>> lang_tool = language_tool.LanguageTool("en-US")
>>> text = "A sentence with a error in the Hitchhiker’s Guide tot he Galaxy"
>>> matches = lang_tool.check(text)
>>> len(matches)
2

Check out some Match object attributes:

>>> matches[0].fromy, matches[0].fromx
(0, 16)
>>> matches[0].ruleId, matches[0].replacements
('EN_A_VS_AN', ['an'])
>>> matches[1].fromy, matches[1].fromx
(0, 50)
>>> matches[1].ruleId, matches[1].replacements
('TOT_HE', ['to the'])

Print a Match object:

>>> print(matches[1])
Line 1, column 51, Rule ID: TOT_HE[1]
Message: Did you mean 'to the'?
Suggestion: to the
... with a error in the Hitchhiker’s Guide tot he Galaxy
                                           ^^^^^^

Automatically apply suggestions to the text:

>>> language_tool.correct(text, matches)
'A sentence with an error in the Hitchhiker’s Guide to the Galaxy'

Installation

To install the package, use:

$ pip install language_tool

Or using uv:

$ uv pip install language_tool

Prerequisites

The installation process should take care of downloading LanguageTool (it may take a few minutes). Otherwise, you can manually download LanguageTool-stable.zip and unzip it into where the language_tool package resides.

LanguageTool requires Java 8 or later.

Metadata

Release files for language_tool 0.4

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

Source distribution (sdist)

Source distribution for language_tool 0.4
File Size Uploaded Provenance
language_tool-0.4.tar.gz 27.8 kB Without provenance Details

Release files / language_tool-0.4.tar.gz

Download URL language_tool-0.4.tar.gz
Size 27.8 kB
Tags Source
SHA-256 checksum
How to use checksums
370fc2ab69f5462366ac2bf8df222e21d770ec18ec1c776194d7d46bd2f09983
BLAKE2b-256 checksum
How to use checksums
5cbc4c499d3452c5996c26052ef27f9bf2ecfecc8f76ab7bb37c56ea163802ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for language_tool 0.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

Release history Release notifications | RSS feed

This release

0.4 This release

1 release file No provenance

0.3a5

0.3a4

0.3a3

0.3a2

0.3a1

0.2a8

0.2a7

0.2a6

0.2a5

0.2a4

0.2a3

0.2a2

0.2a1

0.2a0

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