Skip to main content

textstat-cli-tddschn

Motivation

Get quick and easy readability and other metrics for your texts right on the command line with textstat, offering more insights than wc and LLM token count.

There's another project on PyPI textstat-cli made by another person, I tried that one before making this. Sadly that one doesn't run on my machine, so I made this one.

Demo

# Using the tool on my latest blog post at https://teddysc.me/blog/raleigh-menswear-stores-review

$ textstat-cli teddysc.me/data/blog/raleigh-menswear-stores-review.mdx

Metric                        Value
----------------------------  ------------------
flesch_reading_ease           67.65
flesch_kincaid_grade          6.8
smog_index                    8.7
coleman_liau_index            13.38
automated_readability_index   13.7
dale_chall_readability_score  8.12
difficult_words               111
linsear_write_formula         4.7272727272727275
gunning_fog                   6.1
text_standard                 8th and 9th grade
fernandez_huerta              104.5
szigriszt_pazos               102.97
gutierrez_polini              38.19
crawford                      2.1
gulpease_index                52.1
osman                         35.41
spache_readability            3.66
mcalpine_eflaw                16.4
reading_time                  77.86
syllable_count                1264
lexicon_count                 858
sentence_count                71
char_count                    5300
letter_count                  4669

Explanation of the metircs can be found at https://github.com/textstat/textstat

Please note that some of these metrics are not meant for English texts.

Features

  • Lots of metrics, see demo above.
  • 3 output formats, table by tabulate (see demo), plain text, or JSON.

Installation

Requires Python>=3.10, <3.12 (textstat requires pkg_resources, which is not available in Python 3.12).

pipx

This is the recommended installation method.

$ pipx install textstat-cli-tddschn

pip

$ pip install textstat-cli-tddschn

Usage

$ textstat-cli --help

usage: textstat-cli [-h] [-j] [-T] FILE

TextStat (https://github.com/textstat/textstat) CLI

positional arguments:
  FILE               Input file

options:
  -h, --help         show this help message and exit
  -j, --json         Output in JSON format (default: False)
  -T, --no-tabulate  Do not output in tabulated format (default: False)

Develop

$ git clone https://github.com/tddschn/textstat-cli-tddschn.git
$ cd textstat-cli-tddschn
$ poetry install

Release files for textstat-cli-tddschn 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 textstat-cli-tddschn 0.1.1
File Size Uploaded
textstat_cli_tddschn-0.1.1.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for textstat-cli-tddschn 0.1.1
File Interpreter ABI Platform
textstat_cli_tddschn-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.2 kB

Release files / textstat_cli_tddschn-0.1.1.tar.gz

Download URL textstat_cli_tddschn-0.1.1.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bf81b5c38dd1200b6c090c30130326bb0b6dede9d130510ea9f4a478cde19f4e
BLAKE2b-256 checksum
How to use checksums
df649ca5df1b4c5b9c0637cd59157dbcb0b0a742041cb5e8ff99b8e43361a847
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.3 Darwin/23.4.0

Release files / textstat_cli_tddschn-0.1.1-py3-none-any.whl

Download URL textstat_cli_tddschn-0.1.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e5dc8a383b0c6666d3f2a5948a71e391c94145d3851a8cf193542311902c1ae
BLAKE2b-256 checksum
How to use checksums
35193eeb4eebc4f24e274c525fa75d6b49b830d0697bcbaa4b0105c9160d99ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.3 Darwin/23.4.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 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