{ "info": { "author": "German Mendez Bravo (Kronuz), Brian M. Clapper", "author_email": "german.mb@gmail.com, bmc@clapper.org", "bugtrack_url": null, "classifiers": [ "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Games/Entertainment", "Topic :: Text Processing :: Filters" ], "description": "# Fortune\n\n## Introduction\n\n`fortunate` is a stripped-down implementation of the classic BSD Unix\n`fortune` command. It combines the capabilities of the `strfile` command\n(which produces the fortune index file) and the `fortunate` command (which\ndisplays a random fortune). It reads the traditional `fortunate` program's\ntext file format.\n\nThis repository contains a *fortune cookie database*. It contains more than\n2,800 quotes collected by Brian M. Clapper since about 1990 or so.\n\n\n## Usage\n\nWhen used as a command line tool:\n\n Usage: fortunate [OPTIONS] [fortune_files ...]\n\n Options:\n -h, --help show this help message and exit\n -v, --verbose when updating the index file, emit verbose messages\n -u, --update update the index file, instead of printing a fortune.\n -V, --version show version and exit.\n -n NUM number of fortune cookies to show\n\nIf you omit the fortune files/paths, `fortunate` looks at the `FORTUNE_FILE`\nenvironment variable. If that environment variable isn't set, `fortunate`\nlooks in `/usr/local/share/games/fortunes`, otherwise, it aborts.\n\nWhen used as a Python library:\n\n```python\nfrom fortunate import Fortunate\ngenerator = Fortunate('/path/to/fortunes')\nprint(generator())\n```\n\n\n## Fortune Cookie File Format\n\nA fortune cookie file is a text file full of quotes. The format is simple:\nThe file consists of paragraphs separated by lines containing a single '%'\ncharacter. For example:\n\n A little caution outflanks a large cavalry.\n -- Bismarck\n %\n A little retrospection shows that although many fine, useful software\n systems have been designed by committees and built as part of multipart\n projects, those software systems that have excited passionate fans are\n those that are the products of one or a few designing minds, great\n designers. Consider Unix, APL, Pascal, Modula, the Smalltalk interface,\n even Fortran; and contrast them with Cobol, PL/I, Algol, MVS/370, and\n MS-DOS.\n -- Fred Brooks, Jr.\n %\n A man is not old until regrets take the place of dreams.\n -- John Barrymore\n\n\n## The Index File\n\nFor efficiency and speed, `fortunate` uses an index file to store the offsets\nand lengths of every fortune in the text fortune file. So, before you can use\n`fortunate` to read a random fortune, you have to generate the data file. With\nthe traditional BSD `fortunate` program, you used the _strfile_(8) command\nto generate the index. With _this_ fortune program, however, you the indexes\nare automatically generated in the user's home directory, inside `~/.fortunate`.\n\nYou should run `fortunate -u` whenever you change the text fortune file(s),\nso a new index can be generated.\n\n\n## Generating a Random Fortune\n\nYou can generate a random fortune simply by running the `fortunate` utility\nwith the path to your text fortunes file:\n\n```sh\nfortunate /path/to/fortunes\n```\n\n\n## Differences\n\nThis version of `fortunate` does not provide some of the more advanced\ncapabilities of the original BSD program. For instance, it lacks:\n\n- the ability to mark offensive and inoffensive fortunes\n- the ability to separate long and short quotes\n- the ability to print all fortunes matching a regular expression\n\nIt does, however, provide the most important function: The ability to display\na random quote from a set of quotes.\n\n\n## License and Copyright Info\n\nThis is free software, released under the following BSD-like license:\n\n Copyright (c) 2018 German Mendez Bravo (Kronuz)\n Copyright (c) 2008 Brian M. Clapper\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n - Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n - The end-user documentation included with the redistribution, if any,\n must include the following acknowlegement:\n\n This product includes software developed by Brian M. Clapper\n (bmc@clapper.org, http://www.clapper.org/bmc/). That software is\n copyright (c) 2008 Brian M. Clapper.\n\n Alternately, this acknowlegement may appear in the software itself, if\n and wherever such third-party acknowlegements normally appear.\n\n THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BRIAN M.\n CLAPPER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n\nThis fortunes file database is provided under the Creative Commons Attribution\n4.0 International License. For details, please see\n.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Kronuz/fortunate", "keywords": "", "license": "BSD-style license", "maintainer": "", "maintainer_email": "", "name": "fortunate", "package_url": "https://pypi.org/project/fortunate/", "platform": "", "project_url": "https://pypi.org/project/fortunate/", "project_urls": { "Homepage": "https://github.com/Kronuz/fortunate" }, "release_url": "https://pypi.org/project/fortunate/1.4.0/", "requires_dist": null, "requires_python": "", "summary": "Python version of old BSD Unix fortune program", "version": "1.4.0" }, "last_serial": 5080219, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "a7c338dedb9cf4443308e3930232d083", "sha256": "6800807ba216bb4b4754bff629c91df455d8b3e1784f4b4497c26437a2081355" }, "downloads": -1, "filename": "fortunate-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a7c338dedb9cf4443308e3930232d083", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 147703, "upload_time": "2018-10-10T17:18:46", "url": "https://files.pythonhosted.org/packages/22/5e/0874c7cc3a716e73c80fca4c3a40527f255bb97f15b25ae98429f1462e3c/fortunate-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "af32b7c40d47783e564e3a1c7ef9457d", "sha256": "1e4db8170f2d8654feafb98924a98a4bb7f9b85cea7ae66ba14e112d65179cbd" }, "downloads": -1, "filename": "fortunate-1.1.0.tar.gz", "has_sig": false, "md5_digest": "af32b7c40d47783e564e3a1c7ef9457d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 147799, "upload_time": "2018-11-22T15:32:10", "url": "https://files.pythonhosted.org/packages/17/d0/0a4b26236e1b015d38d96c55d00005e09ed276b8afa78747e28ed71f2aa8/fortunate-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "9c95f9ceb195f3924106a750d1d5b628", "sha256": "59dfe1389ade09bc0a980161713750169207a1833ee63c6544605bc16824f12d" }, "downloads": -1, "filename": "fortunate-1.2.0.tar.gz", "has_sig": false, "md5_digest": "9c95f9ceb195f3924106a750d1d5b628", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 147811, "upload_time": "2018-11-22T15:36:58", "url": "https://files.pythonhosted.org/packages/17/89/92a26dea0cd7ceb5cd4867149d04246931aeb81b98e98947549c466b69a8/fortunate-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "383f2e8361ad133f72b09381d291689a", "sha256": "ed420840e9c87ffa7b77aa23a334b1545be4156f5f827746beb6dcece1bad40c" }, "downloads": -1, "filename": "fortunate-1.3.0.tar.gz", "has_sig": false, "md5_digest": "383f2e8361ad133f72b09381d291689a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 147846, "upload_time": "2018-11-22T15:47:50", "url": "https://files.pythonhosted.org/packages/a9/56/a974261882c9315ba6103510622b83756c10bc03b66e306a171fe0569ed4/fortunate-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "9e3683c746b27b6805f295966f7a1458", "sha256": "76e0d43daf115aa2a241d672aecb5cf595ac1b16efd7b25d23e200a2beff1eaa" }, "downloads": -1, "filename": "fortunate-1.4.0.tar.gz", "has_sig": false, "md5_digest": "9e3683c746b27b6805f295966f7a1458", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 147877, "upload_time": "2019-04-02T19:04:02", "url": "https://files.pythonhosted.org/packages/ad/5f/a474a5c4a118e8aafaafdb541768aa8289c1c2014b6b81d68c96f4f9ca5c/fortunate-1.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9e3683c746b27b6805f295966f7a1458", "sha256": "76e0d43daf115aa2a241d672aecb5cf595ac1b16efd7b25d23e200a2beff1eaa" }, "downloads": -1, "filename": "fortunate-1.4.0.tar.gz", "has_sig": false, "md5_digest": "9e3683c746b27b6805f295966f7a1458", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 147877, "upload_time": "2019-04-02T19:04:02", "url": "https://files.pythonhosted.org/packages/ad/5f/a474a5c4a118e8aafaafdb541768aa8289c1c2014b6b81d68c96f4f9ca5c/fortunate-1.4.0.tar.gz" } ] }