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 docs.plainlicense.org/readscore.

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.0.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.0-py3-none-any.whl (160.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: readscore-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 2a8e8d12566606aa6ee38af62a8f6d3675b40b891db770703acf360d1f45d44e
MD5 ab21a7d96f42f445a6e8a617406ae9e4
BLAKE2b-256 ea9617f32f9a9670dfe1378611abc7d811329df85c6ec0502b3a9ae8e976cdb5

See more details on using hashes here.

File details

Details for the file readscore-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: readscore-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 768b1c3fd2d9bdd966d5173283a64bd04914c505fbad86b2313157ff1b9f85ea
MD5 29c91455f045093e82ec8e527a6841da
BLAKE2b-256 2d87ef19729c47088daae1e54893284bbd1181d67692eb4999a8387e43b303ca

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