A text analytics library for prose fiction.
Project description
A relatively fast, functional prose text counter with readability scoring.
Installation
prosegrinder is available on PyPI. Simply install it with pip:
$ pip install prosegrinder
Usage
The main use is via the prosegrinder.Prose object.
>>> from prosegrinder import Prose >>> p = Prose("Some lengthy text that's actual prose, like a novel or article.")
The Prose object will parse everything down and compute basic staticstics, including word count, sentence count, paragraph count, syllable count, point of view, dialogue, narrative, and a set of readabilit scores. All objects and attributes should be treated as immutable.
I know this isn’t great documentation, but it should be enough to get you going.
Command Line Interaface
Prosegrinder now includes a simple CLI for analyzing text in a file::
Usage: prosegrinder [OPTIONS] FILE Options: -s, --save FILENAME -i, --indent INTEGER --help Show this message and exit.
Will provide basic statistics on text from a file, the filename, and the sh256 of text analyzed. Output is json to help facilitate use in automation::
{ "filename": "./tests/resources/shortstory.txt", "sha256": "5b756dea7c7f0088ff3692e402466af7f4fc493fa357c1ae959fa4493943fc03", "word_character_count": 7008, "phone_count": 5747, "syllable_count": 2287, "word_count": 1528, "sentence_count": 90, "paragraph_count": 77, "complex_word_count": 202, "long_word_count": 275, "pov_word_count": 113, "first_person_word_count": 8, "second_person_word_count": 74, "third_person_word_count": 31, "pov": "first", "readability_scores": { "automated_readability_index": 0.281, "coleman_liau_index": 9.425, "flesch_kincaid_grade_level": 8.693, "flesch_reading_ease": 62.979, "gunning_fog_index": 12.079, "linsear_write": 10.733, "lix": 34.975, "rix": 3.056, "smog": 11.688 } }
Readbility scores
The set of scores automatically calculated:
Automated Readability Index
Coleman Liau Index
Flesch Kincaid Grade Level
Flesch Reading Ease
Gunning Fog Index
Linsear Write
LIX
RIX
SMOG
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
Hashes for prosegrinder-1.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d43e8b65a6f5f9adc198a328fafeb9c602192736ee67e5af6df433544274d544 |
|
MD5 | e08038c86c0c00b9bc7827e67b1c9329 |
|
BLAKE2b-256 | 95f7d5bb29ab70820e3e9e7fa9e6acb1e2778f5f262fc6a268ec1b69d1811a3e |