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
Metadata
Release files for randfacts 0.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| randfacts-0.6.2.tar.gz | 194.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| randfacts-0.6.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 390.0 kB
Release files / randfacts-0.6.2.tar.gz
| Download URL | randfacts-0.6.2.tar.gz |
|---|---|
| Size | 194.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd46ff6e781b0f56fbb7d7c5426c161aced4e0d4ce597f01d8db17c5d3077fb4
|
|
BLAKE2b-256 checksum How to use checksums |
6f0f1a917246a1909c4c343aa0bd7946152bf9585d7cf75ca4d8f5f8156ac048
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / randfacts-0.6.2-py3-none-any.whl
| Download URL | randfacts-0.6.2-py3-none-any.whl |
|---|---|
| Size | 195.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3475340bfe8bed95acc43d8e44cd74339e414303b450fa22004704c739a0a5e0
|
|
BLAKE2b-256 checksum How to use checksums |
dfad32b5e4d0fe5ea5893642bbb8e1780c3fc5859561ecab56455623a1234db9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for randfacts 0.6.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.