Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A Commandline tool to mine haiku poems from text

Project description

Guten Haiku

Build Status Latest Version Python Support

A Commandline tool to mine haiku poems from text

  • 80's cli interface with colors
  • Works great with gutenberg books thx to a builtin cleaner script from Peyman Mohseni Kiasari
  • Reconstructs punctuation of haikus using deepcorrect
  • Appends json haiku's to a file


$ pip install gutenhaiku

Then you need to download the models in cache:

$ gutenhaiku setup


$ gutenhaiku -f frankenstein.txt -a 'mary shelley' -t 'frankenstein' -d '1818-01-01'

Wat?             Guten Haiko lets you extract haiku poems from text
Usage:           gutenhaiku \
                 -f frankenstein.txt \
                 -a 'Mary Wollstonecraft Shelley' \
                 -t 'frankenstein' \
                 -d '1818-01-01'
Optional params: --commandfile [-cf] a file with comma seperated 
                                     values for f,a,t,d params
                 --outputfile   [-o] the output file path [default haiku.json
                 --eighties     [-e] eighties mode [default 1]

Advanced usage:  gutenhaiku \
                 -f frankenstein.txt \
                 -a 'Mary Wollstonecraft Shelley' \
                 -t 'frankenstein' \
                 -d '1818-01-01' \
                 -f dracula.txt \
                 -a 'Bram Stoker' \
                 -t 'dracula' \
                 -d '1897-05-26'

setup:           gutenhaiku setup
                 downloads AI models

Output format

example from assets

    "page": 261,
    "word_number": 65407,
    "haiku": [
        "He pointed towards.",
        "The corpse of my wife I rushed.",
        "Towards the window."
    "author": "mary shelley",
    "title": "frankenstein",
    "date": "1818-01-01T00:00:00"


Run tests with

$ poetry run nox

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gutenhaiku, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size gutenhaiku-1.0.1-py3-none-any.whl (14.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size gutenhaiku-1.0.1.tar.gz (12.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page