You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lbeckman314 b02d8cd7d2 updated and README 4 years ago
withfeathers updated and README 4 years ago changed to 4 years ago
.gitignore changed to 4 years ago
LICENSE changed to 4 years ago changed to 4 years ago updated and README 4 years ago
requirements.txt changed to 4 years ago changed to 4 years ago
withfeathers.wsgi changed to 4 years ago

Output a randomly chosen poem by emily dickinson. Poems were retrieved from Project Gutenberg. Optionally download and parse the poems straight from the source!

To print a poem, add the --print flag to!

$ python3 withfeathers/ --print --decorate --time



Great streets of silence led away
To neighborhoods of pause;
Here was no notice, no dissent,
No universe, no laws.

By clocks 't was morning, and for night
The bells at distance called;
But epoch had no basis here,
For period exhaled.

~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~

time elapsed: 39.45207595825195 ms

A really good R implementation (and inspiration for this program) is this one! -> Display a random Emily Dickinson poem (Gutenberg edition)


0. Prerequisites

python 3 :: for running the script.

git :: for a quick git clone.

If you are running Windows, the above utilities will be packaged in any of the following: babun, cmder, or Linux Subsystem for Windows. Take your pick! : )

The above utilities should be installed (or readily available) if you are running a Unix derivative (such as Linux, macOS, or any of the BSD's).

1. Quickstart

# clone the git repo
git clone

# enter directory
cd withFeathers

# setup dependencies
python3 -m venv virtual
source virtual/bin/activate
pip install flask

# test flask server (for development, don't use for production)
cd withfeathers flask run

# run the script
python3 --print --time


0. Delete the directory.

rm -rfI withFeathers


Poems will be downloaded into a file (e.g. pg12242.txt) in's working directory. The file will then be parsed into individual poem files into a directory (e.g. emilyPoems), from which random poems will be selected.

python --help will print all options accepted by

$ python withfeathers/ --help
usage: [-h] [-c] [-d] [-f FILENAME] [-o OUTPUTDIR] [-p] [-r] [-t]
               [-u URL] [-v]

Print some poems!

optional arguments:
  -h, --help            show this help message and exit
  -c, --clean           remove files/dirs after run (default: False)
  -d, --decorate        decorate the output (default: False)
  -f FILENAME, --filename FILENAME
                        specify filename of source file (default: pg12242.txt)
                        specify directory path of poem files (default:
  -p, --print           print poems to stdout (default: False)
  -r, --randomoff       toggle picking random poem (default: False)
  -t, --time            print time elapsed to stdout (default: False)
  -u URL, --url URL     specify source url
  -v, --version         show program's version number and exit