Skip to content

Instantly share code, notes, and snippets.

@omiq
Created February 24, 2018 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omiq/e3722435dd9cb3b719f33f3970edda4b to your computer and use it in GitHub Desktop.
Save omiq/e3722435dd9cb3b719f33f3970edda4b to your computer and use it in GitHub Desktop.
Version 2 - readability from a text file
# these modules help us do the script
import html2text
import requests
import sys
# this is the important library that acutally does the work
from textstat.textstat import textstat
with open('testfile.txt', 'r') as content_file:
test_string = content_file.read()
# show what we grabbed
print( test_string )
print()
# So how readable is it?
print( str(textstat.flesch_reading_ease(test_string)) + " /100" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment