Skip to main content

Package to generate random facts

Project description

PyPI AUR version Downloads PyPI license Maintenance GitHub Issues GitHub Workflow Status GitHub followers GitHub Repo stars
Kofi Badge

Randfacts is a Python module that generates random facts. You can use randfacts.get_fact() to return a random fun fact. Disclaimer: Facts are not guaranteed to be true.

Installation

randfacts can either be installed via pip or via the AUR, whichever way you prefer.

Installation via pip:

$ pip3 install randfacts

Installation via AUR:

Via your AUR helper, like paru:

$ paru -S python-randfacts

Or manually

$ git clone https://aur.archlinux.org/python-randfacts.git && cd python-randfacts
$ makepkg -si

Usage and examples

import randfacts
x = randfacts.get_fact()
print(x)

The above example will print a random fact like: Penguins can't taste sweet or savory flavors, only sour and salty ones

This package has a filter option to filter out potentially inappropriate facts. The filter is on by default. To disable the filter, you can just set the filter_enabled parameter to False.

from randfacts import get_fact
print(get_fact(False))
# or
print(get_fact(filter_enabled=False))

get_fact also has a parameter that will make the function only return unsafe facts. This argument takes precedence over the filter_enabled argument. For example:

print(get_fact(only_unsafe=True))

If you want to access the list of facts directly, you can just import the safe_facts, unsafe_facts, or all_facts lists from the randfacts module.

Command line usage

randfacts can be executed via the command line with the following commands:

Normal execution; only SFW (safe for work) facts

$ python3 -m randfacts

The unsafe argument can be supplied to provide only NSFW (not safe for work) facts

$ python3 -m randfacts --unsafe

The mixed argument can be provided to provide both SFW and NSFW facts.

$ python3 -m randfacts --mixed

More help.

$ python3 -m randfacts --help

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

randfacts-0.22.0.tar.gz (272.7 kB view details)

Uploaded Source

Built Distribution

randfacts-0.22.0-py3-none-any.whl (273.6 kB view details)

Uploaded Python 3

File details

Details for the file randfacts-0.22.0.tar.gz.

File metadata

  • Download URL: randfacts-0.22.0.tar.gz
  • Upload date:
  • Size: 272.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.7

File hashes

Hashes for randfacts-0.22.0.tar.gz
Algorithm Hash digest
SHA256 84d5126c518aa89544399d8278a5c6f2353c9cce4929be7730c3cba5ba2c4443
MD5 2fc492a5ec0695ac3a9a68735705af87
BLAKE2b-256 f7cb711a27e7346f3ca86f090ff7988a0c96b789d93d2bfa6221cf8e40b001eb

See more details on using hashes here.

File details

Details for the file randfacts-0.22.0-py3-none-any.whl.

File metadata

  • Download URL: randfacts-0.22.0-py3-none-any.whl
  • Upload date:
  • Size: 273.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.7

File hashes

Hashes for randfacts-0.22.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9956e7c1d9d275438fe5fcdd27582b0ca6b5a0b6ef9e86681f6ebbc447551f06
MD5 92dd2e1b5ecb0be750eb1ea9df209e9b
BLAKE2b-256 f497f505adc2b477eb1899319bebdff7dc5a00cf5009b3ce3bb3cb7b006b505b

See more details on using hashes here.

Supported by

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