Modernized readability scoring for Python
Project description
readscore
Score the readability of text using popular readability formulas and metrics including: Flesch Kincaid Grade Level, Flesch Reading Ease, Gunning Fog Index, Dale Chall Readability, Automated Readability Index (ARI), Coleman Liau Index, Linsear Write, SMOG, and SPACHE.
Prerequisites
- Python 3.12 or higher
Installation
pip install readscore
Quick Start
from readscore import Readability
text = """
In linguistics, the Gunning fog index is a readability test for English writing.
The index estimates the years of formal education a person needs to understand
the text on the first reading. For instance, a fog index of 12 requires the
reading level of a United States high school senior (around 18 years old).
The test was developed in 1952 by Robert Gunning, an American businessman
who had been involved in newspaper and textbook publishing.
"""
r = Readability(text)
# Automated Readability Index (ARI)
ari = r.ari()
print(f"ARI Score: {ari.score}")
print(f"Grade Levels: {ari.grade_levels}")
print(f"Ages: {ari.ages}")
# Flesch Reading Ease
flesch = r.flesch()
print(f"Flesch Score: {flesch.score}")
print(f"Ease: {flesch.ease}")
# Flesch-Kincaid Grade Level
fk = r.flesch_kincaid()
print(f"FK Score: {fk.score}")
print(f"Grade Level: {fk.grade_level}")
# Get all statistics used for calculation
stats = r.statistics()
print(stats)
# For custom metrics, use r.stats (returns a StatSummary object)
print(r.stats)
For score interpretation, metric selection, and full API docs, see readscore.plainlicense.org.
About
readscore is a fork of the excellent py-readability-metrics library by Carmine DiMascio (@cdimascio). We wanted to build on the great work that Carmine did, and add some additional features and metrics as an engine for future Plain License projects, like our in-development CLI tool, plainr and similar plain language focused CI/CD tools. We also wanted to make some major breaking changes to the API and add robust typing support, so we decided to fork the project and start fresh.
Supported Metrics
- ARI (Automated Readability Index)
- Coleman-Liau Index
- Dale-Chall Readability Score
- Flesch Reading Ease
- Flesch-Kincaid Grade Level
- Gunning Fog Index
- Linsear Write Formula
- SMOG Index
- Spache Readability Formula
Acknowledgements
readscore is a fork of py-readability-metrics by Carmine DiMascio. We are grateful for that foundation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file readscore-1.0.1.tar.gz.
File metadata
- Download URL: readscore-1.0.1.tar.gz
- Upload date:
- Size: 137.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a03b1781e4492a83dd1b7c18bd0b7c989899157f6bc4b54974ed52a1d6580373
|
|
| MD5 |
f8264f61499a1f7036c5e4e215f9bb74
|
|
| BLAKE2b-256 |
59629c87f2d33e91db77f760963ca5dd63dcd197270bc1f871296c828ffc65c7
|
File details
Details for the file readscore-1.0.1-py3-none-any.whl.
File metadata
- Download URL: readscore-1.0.1-py3-none-any.whl
- Upload date:
- Size: 160.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f111cba274bc94e71fc91af393a83035fad1d3e7cfd7f1ad50781a60935037e
|
|
| MD5 |
6cc5363042e8744591aabcfc9ae57601
|
|
| BLAKE2b-256 |
bf35a60c269a8e8066f38dc5a24c9cef38233b74ded62867eb54e0ab42f640d5
|