Package to generate random facts
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for randfacts-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de97a35049c2c37bf09e6207edb479d311cd9208eea4161f00957a0112ffbea4 |
|
MD5 | 01c66fc9d073f350e8562e316295a942 |
|
BLAKE2b-256 | 1ac8254c8822be4c0d7941a3806118ce6acbe534ae0063436f276a614bb80896 |