Generate random strings that make sense.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Prpeare v1.2.0 Jan 1, 2018
fabulist
tests Ignore PyDev and PyCharm Mar 1, 2018
.editorconfig
.flake8 First implementation Aug 1, 2017
.gitignore Ignore PyDev and PyCharm Mar 1, 2018
.travis.yml
CHANGES.md
LICENSE First implementation Aug 1, 2017
MANIFEST.in
Pipfile Fix setup.cfg Aug 6, 2017
README.md Fix slideshow URL Sep 22, 2017
TODO Cleanup Dec 30, 2017
_config.yml Set theme jekyll-theme-leap-day Aug 15, 2017
logo.png
readme_pypi.rst Update docs Aug 28, 2017
requirements-dev.txt Add MANIFEST.in Jan 1, 2018
requirements.txt
setup.cfg Add MANIFEST.in Jan 1, 2018
setup.py Cleanup Dec 30, 2017
tox.ini

README.md

Fabulist

Powered by You Build Status Latest Version License Documentation Status

Generate meaningful test data based on string templates.

Usage

$ pip install fabulist

then

from fabulist import Fabulist

fab = Fabulist()

templates = [
    "$(Verb:ing) is better than $(verb:ing).",
    "$(Noun:an) a day keeps the $(noun:plural) away.",
    "If you want to $(verb) $(adv), $(verb) $(adv)!",
    'Confucius says: "The one who wants to $(verb) must $(verb) $(adv) the $(noun)!"',
    ]
print("Fortune cookies:")
for q in fab.generate_quotes(templates, count=10):
    print("- ", q)

will produce something like

Fortune cookies:
-  A statement a day keeps the airports away.
-  Savoring is better than magnifying.
-  If you want to sate divisively, disuse calmly!
-  Praying is better than inspecting.
-  Confucius says: "The one who wants to sterilize must inform miserably the possibility!"
-  If you want to blur orderly, stride poorly!
-  A cost a day keeps the gears away.
-  Subtracting is better than worshipping.
-  If you want to damage solely, discuss jealously!
-  Confucius says: "The one who wants to vanish must swear terribly the punch!"

See also the Introduction Slides and Read The Docs for details.