Simple python package to generate random dictionaries of given types.
Project description
Simple python package to generate random dictionaries of given types.
How do I install this package?
As usual, just download it using pip:
pip install random_dict
Usage examples
random_string_dict
This function will generate a dictionary with given at most max_depth and max_height of type string.
from random_dict import random_string_dict
from random import randint
random_string_dict(randint(1, 10), randint(1, 10))
random_bool_dict
This function will generate a dictionary with given at most max_depth and max_height of type bool.
from random_dict import random_bool_dict
from random import randint
random_bool_dict(randint(1, 10), randint(1, 10))
random_float_dict
This function will generate a dictionary with given at most max_depth and max_height of type float.
from random_dict import random_float_dict
from random import randint
random_float_dict(randint(1, 10), randint(1, 10))
random_int_dict
This function will generate a dictionary with given at most max_depth and max_height of type int.
from random_dict import random_int_dict
from random import randint
random_int_dict(randint(1, 10), randint(1, 10))
random_dict
This function will generate a dictionary with given at most max_depth and max_height of mixed types.
from random_dict import random_dict
from random import randint
random_dict(randint(1, 10), randint(1, 10))
Some generated examples can be found within the examples folder.
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
File details
Details for the file random_dict-1.0.0.tar.gz
.
File metadata
- Download URL: random_dict-1.0.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.13.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddfe0d95ed792028e281a2ce029422e57149ea473b370ee2197c375b5818eed0 |
|
MD5 | 6b41bcd50bd9af4881a38e65f6c1af43 |
|
BLAKE2b-256 | 2b74fe5cef75b575bec35e397148382687139540f529bb98947c576c78f4d97b |