Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.0rc1.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.0rc1-cp310-abi3-win_arm64.whl (1.8 MB view details)

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

textstat_rs-1.0.0rc1-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.0rc1-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.0rc1-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.0rc1-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.0rc1-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.0rc1-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.0rc1-cp310-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

textstat_rs-1.0.0rc1-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.0rc1.tar.gz.

File metadata

  • Download URL: textstat_rs-1.0.0rc1.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.0rc1.tar.gz
Algorithm Hash digest
SHA256 2a9da4b5a4d83b108571ae34dcd5ce6fe1fdcc5932339344399bf7b9b4749939
MD5 cdc62b9b0e64ababae1ad09f5a92a127
BLAKE2b-256 c694de4ff0dad9f15d0799abf31955243e0c2a060e58a690b0d0e29485deae6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1.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.0rc1-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0rc1-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 8df6ef395097a4d36a2714a5cedf190f902ef3957d0a7c0923b96ef0cf2c51c8
MD5 4d82ad0c3d6f4503028f8e8241947a28
BLAKE2b-256 d2127747598b92724e30e2fdbb8865a4e490d31ba9bdb620631ac36e49a65300

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1-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.0rc1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0rc1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c67ce3822cf112d820b41ccd0157d44bb1ff8a72e5480ba3431cdebd0e298f2d
MD5 1c3d279191ec94cd3fbcb6bfee57f773
BLAKE2b-256 94346fb915242cefe42f16b9fd630a986a3e9a4f9dc906bdf84a396107bd82bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1-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.0rc1-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0rc1-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d5d68ec09e510708462b3587df91da2ecc3361d0f637061e9bd6d78ad1126c40
MD5 9a09f740ab71c902c8cda6c051feaf47
BLAKE2b-256 50e942026a88f5d715b64134f02d70b9d0345d001280b51be3c1f793d8923fab

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1-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.0rc1-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0rc1-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 01c21e29d53a7b9f18de5c1270eddeeeb58e9e9096029f8b2432287c9eabf85f
MD5 d243ba8b40d84a5b95907f267c59b051
BLAKE2b-256 0f755f6ba70c45ed01d6910782124ae7a634e7dbf571ce713d7845f65a186afa

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1-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.0rc1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0rc1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fbbbb3f93c049ad2cebdb8655a5cf1a48cfb2c8cd711e7e6ee0e10f74cc8e4bc
MD5 974226e22bd2d531a315ee35fceb23fd
BLAKE2b-256 8795225eeea920b003cc3eef0801239a74f89d1d75cfdea598c7f6a44882d782

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1-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.0rc1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0rc1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 090cfe37a230f38ee44145f2fc5e7c3443cde240b8dc45f0b1677c6484b65b79
MD5 0c8ec560e276ddf19c52b476bea140de
BLAKE2b-256 1e6078f7b6faa1ef7228833816d8c8e1eb6934a9d2312bd9fd4b6ba81b709857

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1-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.0rc1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0rc1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 534e710b2fc4e20f94628733c2ef046840f5d1d96dfbd2f642aa51e4d2fb27ea
MD5 a9c2102aeb18a37255a388ea3736ed57
BLAKE2b-256 0422beaff2ef8492ef4f73168b6e10d7744dfcdcc931f9a6955d23ebd398a363

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1-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.0rc1-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0rc1-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 cfb00899eddc97eea1f03b1ed0a4247d2ab4b2aa373dbd19c86e50885e54e179
MD5 722bfee31e15069d333672506b36f396
BLAKE2b-256 4db0b9134083c1c0538949c16fba4a9eaf0dd069b9c70c1b98a23eba436397ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1-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.0rc1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0rc1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 357b7b820f21970c1189e7812a96dff19e3164b56e81652d33970ff07b1622eb
MD5 b2de2f3b8d53bb4bed53f23f1fc52f37
BLAKE2b-256 415b2078d5213dfe6f84b5800e87cebbab2fb106d239aa229bf822a6989a2d21

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1-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.0rc1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for textstat_rs-1.0.0rc1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6001e7df552140cf6978d55fef89f19853c9d2e1a06edbb17b0ebda1aebdc8bd
MD5 273939801a9dc86930089697789d700b
BLAKE2b-256 b69c4a3aaf15f9f2f5a7f615c54bac0151d966aa061249bd25e655ebb6e6c1ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for textstat_rs-1.0.0rc1-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

1.0.0

11 files

This release

1.0.0rc1 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