Skip to main content

Package to generate random facts

Project description

PyPI version Downloads PyPI license Maintenance GitHub issues

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

Example:

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

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 getFact
print(getFact(False))

getFact 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(getFact(only_unsafe=True))

If you want to access the list of facts directly, you can just import the safeFacts, unsafeFacts, or allFacts lists from the randfacts module.

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

Normal execution; only safe facts

$ python3 -m randfacts

The unsafe argument can be supplied to provide only unsafe facts

$ python3 -m randfacts --unsafe

The mixed argument can be provided to provide both safe and unsafe 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.6.2.tar.gz (194.5 kB view details)

Uploaded Source

Built Distribution

randfacts-0.6.2-py3-none-any.whl (195.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: randfacts-0.6.2.tar.gz
  • Upload date:
  • Size: 194.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for randfacts-0.6.2.tar.gz
Algorithm Hash digest
SHA256 dd46ff6e781b0f56fbb7d7c5426c161aced4e0d4ce597f01d8db17c5d3077fb4
MD5 610b0e55503748fa172da977a4750a06
BLAKE2b-256 6f0f1a917246a1909c4c343aa0bd7946152bf9585d7cf75ca4d8f5f8156ac048

See more details on using hashes here.

File details

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

File metadata

  • Download URL: randfacts-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 195.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for randfacts-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3475340bfe8bed95acc43d8e44cd74339e414303b450fa22004704c739a0a5e0
MD5 2ecbd9625a0e61a13e700ee1911765da
BLAKE2b-256 dfad32b5e4d0fe5ea5893642bbb8e1780c3fc5859561ecab56455623a1234db9

See more details on using hashes here.

Supported by

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