Skip to content

Recipes to generate random instances of various types, beyond the scope of random.

License

Notifications You must be signed in to change notification settings

ipear3/random-recipes

Repository files navigation

Random Recipes

pypi downloads tests coverage

Recipes to generate random instances of various types, beyond the scope of random.

Python's random implements generators for pseudo-random bytes, integers, and sequences. In random-recipes we collect additional functions to generate random instances of common object types, collection types, and file types that may be useful.

Recipes

Objects

Object Type Function
bool random_bool
bytes random_bytes
decimal.Decimal random_decimal
datetime.date random_date
datetime.datetime random_datetime
float random_float
fractions.Fraction random_fraction
int random_int
str random_str

Collections

Collection Type Function
dict random_dict
collections.abc.Iterable[dict] random_dicts

Files

File Extension Function
.csv random_csv

Installation

Install the library with pip from PyPi: pip install random-recipes