Created
February 24, 2018 20:23
-
-
Save omiq/e3722435dd9cb3b719f33f3970edda4b to your computer and use it in GitHub Desktop.
Version 2 - readability from a text file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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