Skip to main content

A Python implementation of fortune

Project description

Fortune Lite

The lightweight python-based fortune cookie generator

Installing

The latest version can be installed by running pip3 install fortune-lite from the command line.

Usage

fortune <options>
Argument Description
-h,
--help
Prints a help-dialogue and exits.
-v,
--version
Prints out version information and exits.
-a,
-all
Selects from all databases, including offensive fortunes.
-e,
--equal
Makes it equally likely that the fortune will be selected from any given category, as opposed to making all fortunes equally likely regardless of category.
-f,
--categories
Instead of printing a fortune, just print a list of all fortune categories (files).
-o,
--offensive
Only print fortunes marked as offensive.
-w,
--wait
Wait the specified number of seconds after printing the fortune before exiting.

Database Locations

Unlike other fortune programs, Fortune Lite is designed to parse fortunes out of specialized SQLite databases. By default, the Fortune Lite program looks for a database at ~/.fortune.db, and falls back to the prepackaged database if no database is found in the user's home directory.
Additionally, the $FORTUNE_DB environment variable can be used to override the default database locations, in which case the fortune program will only fall back to the default locations in the event that no database is found at the location stored in $FORTUNE_DB.

Building from Source

  1. Acquire the source code: git clone https://github.com/buck-ross/fortune_lite.git.
  2. Enter the source directory: cd fortune_lite
  3. (optional) Checkout the version you want to build: git checkout tags/v1.0.1
  4. Build and install the package: python3 setup.py install

Credit to fortune-mod

While Fortune Lite is a completely distinct and independent project from fortune-mod, we do currently use the datfile sources provided by fortune-mod in order to generate the SQLite fortune database. As such, the fortune-mod project deserves all credit for creating and the default fortune database.

License

Copyright © 2019 Buckley Ross
This project is licensed under the Apache License, Version 2.0 (Apache-2.0).
For a complete copy of the license, please see the included "LICENSE" file.

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

fortune_lite-1.0.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fortune_lite-1.0.1-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file fortune_lite-1.0.1.tar.gz.

File metadata

  • Download URL: fortune_lite-1.0.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for fortune_lite-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3cf2ec38cc3ac1775297514bdc6d6a6a1b749ae920023383ce129f7e3e5b7d70
MD5 af981acb5ed27cd84b7065636757b444
BLAKE2b-256 44e97fbd5536844842b69c231fa9a51a8b680c9264f531fe4411a9c79de03881

See more details on using hashes here.

File details

Details for the file fortune_lite-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: fortune_lite-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for fortune_lite-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 df9ff82be16d5ea7d8012865b1d15d3a8236fb9da64b7d4311befaf2affa1533
MD5 0e105f8ec58d51ab1fc86118df8daa40
BLAKE2b-256 ad0f9a1baed9f2cb85dbb9bbca99f796a718e7772c5f9f1f25be256c63827b5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page