"Generate random strings that make sense."
Project description
Fabulist
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fabulist-2.0.1.tar.gz
(77.4 kB
view details)
Built Distribution
fabulist-2.0.1-py3-none-any.whl
(67.1 kB
view details)
File details
Details for the file fabulist-2.0.1.tar.gz
.
File metadata
- Download URL: fabulist-2.0.1.tar.gz
- Upload date:
- Size: 77.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fee0f340e404808ea94458521e28e94301f2329688c35a0bfa9108c5d852307d |
|
MD5 | e243ce52390b08258f92bf53bf4a036d |
|
BLAKE2b-256 | 8993f5275cb92666aaa034a89ac342f67c5780476936e969256d5b75d5d4c49c |
File details
Details for the file fabulist-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: fabulist-2.0.1-py3-none-any.whl
- Upload date:
- Size: 67.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d17aee99f5d2a10490f505b12036641a0514c14e7998a5cb4e9a1bd02072dd0 |
|
MD5 | c1bb98c00c42b6630e5efebc95754fc2 |
|
BLAKE2b-256 | 43c1ecb8a6072af48172d5f26a37ba262957820ebb3ca1c44b8df863f6b516c0 |