Skip to main content

Modernized readability scoring for Python

Project description

readscore

readscore

MIT license

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.

GitHub stars

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


Download files

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

Source Distribution

readscore-1.0.1.tar.gz (137.6 kB view details)

Uploaded Source

Built Distribution

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

readscore-1.0.1-py3-none-any.whl (160.3 kB view details)

Uploaded Python 3

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

Hashes for readscore-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a03b1781e4492a83dd1b7c18bd0b7c989899157f6bc4b54974ed52a1d6580373
MD5 f8264f61499a1f7036c5e4e215f9bb74
BLAKE2b-256 59629c87f2d33e91db77f760963ca5dd63dcd197270bc1f871296c828ffc65c7

See more details on using hashes here.

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

Hashes for readscore-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f111cba274bc94e71fc91af393a83035fad1d3e7cfd7f1ad50781a60935037e
MD5 6cc5363042e8744591aabcfc9ae57601
BLAKE2b-256 bf35a60c269a8e8066f38dc5a24c9cef38233b74ded62867eb54e0ab42f640d5

See more details on using hashes here.

Supported by

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