Democritus Random
Democritus functions[1] for working with random.
[1] Democritus functions are simple, effective, modular, well-tested, and well-documented Python functions.
We use d8s (pronounced "dee-eights") as an abbreviation for democritus (you can read more about this here).
Installation
pip install d8s-random
Usage
You import the library like:
from d8s_random import *
Once imported, you can use any of the functions listed below.
Functions
-
def random_number(): """Return a random number in range [0.0, 1.0)."""
-
def random_integer(a=0, b=10): """Return a random number between a and b (inclusive)."""
-
def random_xkcd_integer(): """Get a random number using the method described here: https://xkcd.com/221/."""
-
def random_dilbert_integer(): """Get a random number using the method described here: https://dilbert.com/strip/2001-10-25c."""
-
def random_shuffle(iterable): """Shuffle the order of the given iterable."""
-
def random_choice(iterable): """Return a random item from the iterable."""
-
def random_choices(iterable, n: int): """Return a random item from the iterable."""
-
def random_sample(iterable, n): """Return n items, selected at random, from the iterable."""
Development
👋 If you want to get involved in this project, we have some short, helpful guides below:
If you have any questions or there is anything we did not cover, please raise an issue and we'll be happy to help.
Credits
This package was created with Cookiecutter and Floyd Hightower's Python project template.
Metadata
Release files for d8s-random 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| d8s_random-0.7.0.tar.gz | 92.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| d8s_random-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 111.0 kB
Release files / d8s_random-0.7.0.tar.gz
| Download URL | d8s_random-0.7.0.tar.gz |
|---|---|
| Size | 92.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd6c3b2ee174e7916f9990600017717c4c9b83420102b27aae2c95cac0ab1be3
|
|
BLAKE2b-256 checksum How to use checksums |
785f780499797ee5eb0b45546b478343cf6bf8f3f226162a6ec572265e73275b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.
Transparency logRelease files / d8s_random-0.7.0-py3-none-any.whl
| Download URL | d8s_random-0.7.0-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f16d2bafd5f74527a664eae137da158935b2ad97681db939d4c9422a0aaaec0
|
|
BLAKE2b-256 checksum How to use checksums |
d804763c4ad3c7bf7506b4776e188f18ae76bb1476af1b9b3fdefd2fd68df223
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.
Transparency log