Skip to main content

Textstat-rs

Rust port of the textstat textual analysis library, with Python bindings. Drop-in replacements for 11 key metrics in US English.

99.98% exact output match, with at least 2.4x-7x speedup, with 2 most sped-up metrics at ~14x and ~79x based on benchmarking scripts included in repo, running on Wikipedia dataset as a varied, modern text corpus.

Installation

pip install textstat-rs

Pre-release versions need pip install --pre textstat-rs.

Requires Python 3.10+. Wheels are built for Linux (x86_64, x86, aarch64, armv7; glibc and musl), macOS (x86_64, arm64) and Windows (x64, arm64). They are abi3 wheels, so one wheel per platform covers every supported Python version. On other platforms pip falls back to the sdist, which needs a Rust toolchain to build.

Usage

Import name is textstat_rs; every metric takes the text as its first argument.

import textstat_rs

text = "The cat sat on the mat. It was a sunny day."

textstat_rs.flesch_reading_ease(text)   # 108.96159090909092
textstat_rs.flesch_kincaid_grade(text)  # -0.5722727272727273
textstat_rs.text_standard(text)         # '0th and 1st grade'

The exposed metrics match textstat's signatures, so an existing import can be swapped in place:

import textstat_rs as textstat

Optional arguments are the same as the Python library, other than the exceptions noted below:

textstat_rs.gunning_fog(text, syllable_threshold=3)
textstat_rs.linsear_write_formula(text, strict_lower=False, strict_upper=True)
textstat_rs.reading_time(text, ms_per_char=14.69)

The counting helpers the formulas are built on are exposed too: syllable_count, sentence_count, lexicon_count, char_count, letter_count, polysyllabcount, miniword_count and difficult_words.

Python Comparison

Functions

Exposed Metrics

Python function Exposed? Notes
flesch_reading_ease
flesch_kincaid_grade
smog_index
coleman_liau_index
automated_readability_index
dale_chall_readability_score
linsear_write_formula signature parity (strict_lower, strict_upper)
gunning_fog Rust exposes syllable_threshold arg, Python hardcodes it
spache_readability Rust missing float_output arg
text_standard Rust missing float_output arg, returns String only
reading_time
mcalpine_eflaw
dale_chall_readability_score_v2
lix
rix
fernandez_huerta Spanish
szigriszt_pazos Spanish
gutierrez_polini Spanish
crawford Spanish
gulpease_index Italian
wiener_sachtextformel German
osman Arabic

Parity

Scores are compared against textstat over 1000 Wikipedia articles (up to 5000 chars each): 99.98% of 11000 comparisons match exactly, and the largest disagreement anywhere is 0.049566.

metric avg delta max delta
flesch_reading_ease 0.000000 0.000000
flesch_kincaid_grade 0.000000 0.000000
automated_readability_index 0.000000 0.000000
coleman_liau_index 0.000000 0.000000
dale_chall_readability_score 0.000000 0.000000
gunning_fog 0.000050 0.049566
smog_index 0.000000 0.000000
linsear_write_formula 0.000000 0.000000
mcalpine_eflaw 0.000000 0.000000
spache_readability 0.000011 0.010657
reading_time 0.000000 0.000000

Generated from 5d3aab1 on 2026-07-25, python 3.12.4 vs textstat 0.7.13, on Windows-11-10.0.26200-SP0.

Performance

One call per metric over 100 concatenated Wikipedia articles (0.46 MB), median of 5. Both libraries are warmed first, so these are steady-state numbers with lazy resource loading excluded.

metric textstat-rs (ms) textstat (ms) speedup
flesch_reading_ease 39.68 145.02 3.65x
flesch_kincaid_grade 34.37 149.34 4.35x
automated_readability_index 16.99 47.21 2.78x
coleman_liau_index 14.81 60.34 4.07x
dale_chall_readability_score 29.23 180.36 6.17x
gunning_fog 28.62 192.56 6.73x
smog_index 28.09 204.73 7.29x
linsear_write_formula 0.05 3.79 79.81x
mcalpine_eflaw 18.05 43.65 2.42x
spache_readability 30.37 192.59 6.34x
reading_time 0.91 13.23 14.58x

On top of that, the first call in a fresh process pays a one-off load of the syllable and word-list resources: up to 32 ms for textstat-rs against 455 ms for textstat.

Generated from 5d3aab1 on 2026-07-25, python 3.12.4 vs textstat 0.7.13, on Windows-11-10.0.26200-SP0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

textstat_rs-1.0.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

textstat_rs-1.0.0-cp310-abi3-win_arm64.whl (1.8 MB view details)

Uploaded CPython 3.10+Windows ARM64

textstat_rs-1.0.0-cp310-abi3-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

textstat_rs-1.0.0-cp310-abi3-musllinux_1_2_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

textstat_rs-1.0.0-cp310-abi3-musllinux_1_2_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARMv7l

textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

textstat_rs-1.0.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl (1.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.5+ i686

textstat_rs-1.0.0-cp310-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

textstat_rs-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file textstat_rs-1.0.0.tar.gz.

File metadata

  • Download URL: textstat_rs-1.0.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for textstat_rs-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9551c61c9648c2b0a36f4ee05ccc7a00c7096e3b04c96cd4286692f50b7ac826
MD5 63be2c3fcd4ccdb36833a0df1903ea15
BLAKE2b-256 d2556af6b94fe604272b6bee75cde28608388e3261f6cb3d3c7d76853412298c

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0.tar.gz:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textstat_rs-1.0.0-cp310-abi3-win_arm64.whl.

File metadata

  • Download URL: textstat_rs-1.0.0-cp310-abi3-win_arm64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.10+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for textstat_rs-1.0.0-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 9c065a32d2345c2850e227c9429d632e07cfbf7fd896e78cb12569ad42590aae
MD5 7845f609d835eab093e6fdd402aac985
BLAKE2b-256 d759e5e67d3af1b5d6ab9dea834dc21461df66e4aac412c656167c558c4740fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0-cp310-abi3-win_arm64.whl:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textstat_rs-1.0.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: textstat_rs-1.0.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for textstat_rs-1.0.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a0eb36da91fe455f8ccb1221db3e7fea7a16ab1850c7bc34123260886880444a
MD5 bf669cf32d7414317749024c198840ba
BLAKE2b-256 879fe37dc5e75cdc358b24565f64d8a5fa3cdfe4de6db93fe4c4f45014980db6

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0-cp310-abi3-win_amd64.whl:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textstat_rs-1.0.0-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e48756e40fee4fa107ac55af68b3b753166d556f5f0ab73bccd5dcd6aeaf8826
MD5 149526b2eb7db9ae994e648a50fba96e
BLAKE2b-256 6c573cfa382d74b7627510893ba5d59db1d2115ccef85822a4dc1bd57a206398

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0-cp310-abi3-musllinux_1_2_x86_64.whl:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textstat_rs-1.0.0-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e8dca96a848f0d61b343d6e496cda885f6d887b16c82a72e505ac1b75ea87836
MD5 6475bb9ea51984b5c4d1fba2e0ff6d38
BLAKE2b-256 55d58ed3c983e097aa483b99125532521c918eecc4d4508de5ba1e991bd96239

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0-cp310-abi3-musllinux_1_2_aarch64.whl:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6e83afa0720671a533c542136708589ea8d23250ced24117e11049597fe57e09
MD5 b794b105ec8ff075df2fee520a6ac4d3
BLAKE2b-256 b329d1548fb1fc807cf60823ff709e3e2b3c9e116426faafb6e511ce659d7291

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 b353be896b94406d14742f70d83060d7a5584df54570b8c3b9eca1231c605114
MD5 12c882fd046e35a03c4cd4287b3cb4c0
BLAKE2b-256 4ea69c086d371207495b09a5f9f938e778d94f4aaacf817a6ac04121fa025af9

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 46a97cca7273ae16c42dec3ba19aedce8e508a086cf597de98b518d896607802
MD5 69ffdde005ce5a034c6f5df14178adbf
BLAKE2b-256 1df05f85a1769c9e7cd334746b9f8f70b5db504f6a0902f586d6be094c2c2230

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textstat_rs-1.0.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 7796b784f477bdb3f6e235a1b1e1bec2cac0c37bc8fefd4e707cb663fbab7638
MD5 f83c5557022e24b9971111521a798556
BLAKE2b-256 87b795e5525a54fc1ad2ef538c62f4b780b899389f016ffa6f5bdfd270306e59

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textstat_rs-1.0.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ef5f99f490d0676e4ce6d2b734532f1312de7b07822b9a4e0ae7cd170552d6de
MD5 531956be7a32381d5d3b9dff43bcb907
BLAKE2b-256 ce46e16f7be313110e43e9e6889142996836c10709515a12ee245349932e024e

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textstat_rs-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cf18f4c5c23b858c50f2eab91545c456f81ffdbe8cac969fa964369669b775ba
MD5 457426a56e2bd9256669c7e376114110
BLAKE2b-256 2719143545da3a99b4c1492c9e9e9f19ca48d1a75e12aba2793097a5ce8a5071

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: CI.yml on CZboop/textstat-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

11 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page