Skip to content

accraze/python-markov-novel

Repository files navigation

Overview

docs Documentation Status
tests
Travis-CI Build Status AppVeyor Build Status Requirements Status
Coverage Status Coverage Status
package PyPI Package latest release PyPI Package monthly downloads PyPI Wheel Supported versions Supported implementations

Write a random novel using markov chains.

  • Free software: BSD license

Installation

pip install markov-novel

Quick Start

import markovify
import markov_novel

with open('path/to/corpus.txt') as f:
    text = f.read()
# Build the model.
text_model = markovify.Text(text)
novel = markov_novel.Novel(text_model, chapter_count=1)
novel.write(novel_title='my-novel', filetype='md')

The novel will be written to your current working directory.

Documentation

https://python-markov-novel.readthedocs.io/

Development

To run the all tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows
set PYTEST_ADDOPTS=--cov-append
tox
Other
PYTEST_ADDOPTS=--cov-append tox