fabulist


Namefabulist JSON
Version 2.0.1 PyPI version JSON
download
home_pagehttps://github.com/mar10/fabulist/
Summary"Generate random strings that make sense."
upload_time2024-09-21 21:24:55
maintainerMartin Wendt
docs_urlNone
authorMartin Wendt
requires_pythonNone
licenseMIT
keywords python test-data word-list generator mock
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fabulist
[![Powered by You](http://sapegin.github.io/powered-by-you/badge.svg)](http://sapegin.github.io/powered-by-you/)
[![Tests](https://github.com/mar10/fabulist/actions/workflows/tests.yml/badge.svg)](https://github.com/mar10/fabulist/actions/workflows/tests.yml)
[![Latest Version](https://img.shields.io/pypi/v/fabulist.svg)](https://pypi.python.org/pypi/fabulist/)
[![License](https://img.shields.io/pypi/l/fabulist.svg)](https://github.com/mar10/fabulist/blob/master/LICENSE.txt)
[![Documentation Status](https://readthedocs.org/projects/fabulist/badge/?version=latest)](http://fabulist.readthedocs.io/)
[![codecov](https://codecov.io/github/mar10/fabulist/branch/main/graph/badge.svg?token=9xmAFm8Icl)](https://codecov.io/github/mar10/fabulist)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Released with: Yabs](https://img.shields.io/badge/released%20with-yabs-yellowgreen)](https://github.com/mar10/yabs)
[![StackOverflow: fabulist](https://img.shields.io/badge/StackOverflow-fabulist-blue.svg)](https://stackoverflow.com/questions/tagged/fabulist)


> Generate meaningful test data based on string templates.

## Usage

```
$ pip install fabulist
```

then

```py
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](https://rawgit.com/mar10/fabulist/master/docs/intro_slides.html)
and [Read The Docs](http://fabulist.readthedocs.org/en/latest/) for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mar10/fabulist/",
    "name": "fabulist",
    "maintainer": "Martin Wendt",
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": "fabulist@wwwendt.de",
    "keywords": "python test-data word-list generator mock",
    "author": "Martin Wendt",
    "author_email": "fabulist@wwwendt.de",
    "download_url": "https://files.pythonhosted.org/packages/89/93/f5275cb92666aaa034a89ac342f67c5780476936e969256d5b75d5d4c49c/fabulist-2.0.1.tar.gz",
    "platform": null,
    "description": "# Fabulist\n[![Powered by You](http://sapegin.github.io/powered-by-you/badge.svg)](http://sapegin.github.io/powered-by-you/)\n[![Tests](https://github.com/mar10/fabulist/actions/workflows/tests.yml/badge.svg)](https://github.com/mar10/fabulist/actions/workflows/tests.yml)\n[![Latest Version](https://img.shields.io/pypi/v/fabulist.svg)](https://pypi.python.org/pypi/fabulist/)\n[![License](https://img.shields.io/pypi/l/fabulist.svg)](https://github.com/mar10/fabulist/blob/master/LICENSE.txt)\n[![Documentation Status](https://readthedocs.org/projects/fabulist/badge/?version=latest)](http://fabulist.readthedocs.io/)\n[![codecov](https://codecov.io/github/mar10/fabulist/branch/main/graph/badge.svg?token=9xmAFm8Icl)](https://codecov.io/github/mar10/fabulist)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![Released with: Yabs](https://img.shields.io/badge/released%20with-yabs-yellowgreen)](https://github.com/mar10/yabs)\n[![StackOverflow: fabulist](https://img.shields.io/badge/StackOverflow-fabulist-blue.svg)](https://stackoverflow.com/questions/tagged/fabulist)\n\n\n> Generate meaningful test data based on string templates.\n\n## Usage\n\n```\n$ pip install fabulist\n```\n\nthen\n\n```py\nfrom fabulist import Fabulist\n\nfab = Fabulist()\n\ntemplates = [\n    \"$(Verb:ing) is better than $(verb:ing).\",\n    \"$(Noun:an) a day keeps the $(noun:plural) away.\",\n    \"If you want to $(verb) $(adv), $(verb) $(adv)!\",\n    'Confucius says: \"The one who wants to $(verb) must $(verb) $(adv) the $(noun)!\"',\n    ]\nprint(\"Fortune cookies:\")\nfor q in fab.generate_quotes(templates, count=10):\n    print(\"- \", q)\n```\nwill produce something like\n```\nFortune cookies:\n-  A statement a day keeps the airports away.\n-  Savoring is better than magnifying.\n-  If you want to sate divisively, disuse calmly!\n-  Praying is better than inspecting.\n-  Confucius says: \"The one who wants to sterilize must inform miserably the possibility!\"\n-  If you want to blur orderly, stride poorly!\n-  A cost a day keeps the gears away.\n-  Subtracting is better than worshipping.\n-  If you want to damage solely, discuss jealously!\n-  Confucius says: \"The one who wants to vanish must swear terribly the punch!\"\n```\n\nSee also the [Introduction Slides](https://rawgit.com/mar10/fabulist/master/docs/intro_slides.html)\nand [Read The Docs](http://fabulist.readthedocs.org/en/latest/) for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\"Generate random strings that make sense.\"",
    "version": "2.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/mar10/fabulist/issues",
        "Documentation": "https://fabulist.readthedocs.io/",
        "Download": "https://github.com/mar10/fabulist/releases/latest",
        "Homepage": "https://github.com/mar10/fabulist/",
        "Source Code": "https://github.com/mar10/fabulist"
    },
    "split_keywords": [
        "python",
        "test-data",
        "word-list",
        "generator",
        "mock"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "43c1ecb8a6072af48172d5f26a37ba262957820ebb3ca1c44b8df863f6b516c0",
                "md5": "c1bb98c00c42b6630e5efebc95754fc2",
                "sha256": "8d17aee99f5d2a10490f505b12036641a0514c14e7998a5cb4e9a1bd02072dd0"
            },
            "downloads": -1,
            "filename": "fabulist-2.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c1bb98c00c42b6630e5efebc95754fc2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 67135,
            "upload_time": "2024-09-21T21:24:53",
            "upload_time_iso_8601": "2024-09-21T21:24:53.786280Z",
            "url": "https://files.pythonhosted.org/packages/43/c1/ecb8a6072af48172d5f26a37ba262957820ebb3ca1c44b8df863f6b516c0/fabulist-2.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8993f5275cb92666aaa034a89ac342f67c5780476936e969256d5b75d5d4c49c",
                "md5": "e243ce52390b08258f92bf53bf4a036d",
                "sha256": "fee0f340e404808ea94458521e28e94301f2329688c35a0bfa9108c5d852307d"
            },
            "downloads": -1,
            "filename": "fabulist-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e243ce52390b08258f92bf53bf4a036d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 77384,
            "upload_time": "2024-09-21T21:24:55",
            "upload_time_iso_8601": "2024-09-21T21:24:55.812157Z",
            "url": "https://files.pythonhosted.org/packages/89/93/f5275cb92666aaa034a89ac342f67c5780476936e969256d5b75d5d4c49c/fabulist-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-21 21:24:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mar10",
    "github_project": "fabulist",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "fabulist"
}
        
Elapsed time: 1.21879s