randpy is a tiny set of utilities to generate random data such as strings, numbers, and dates.
Basic Data
>>> import randpy
>>> randpy.random_boolean()
True
>>> randpy.random_boolean()
False
>>> randpy.random_integer(minimum=0, maximum=10)
0
>>> randpy.random_integer(minimum=0, maximum=10)
10
>>> randpy.random_integer(minimum=0, maximum=10)
3
>>> randpy.random_decimal(minimum=0, maximum=1)
0.52
>>> randpy.random_decimal(minimum=0, maximum=5, digits=4)
1.9944
>>> randpy.random_choice([1, 2, 3, 4])
1
>>> randpy.random_choices([1, 2, 3, 4], 2)
[4, 4]
>>> randpy.random_choices([1, 2, 3, 4], 3)
[3, 1, 1]
Generators
>>> from randpy import generators
>>> generators.phone_number()
'2776904659'
>>> generators.phone_number(international_code=True)
'12776904659'
>>> randpy.address()
'865 Elm'
>>> randpy.address()
'652 S Blueridge Pl.'
>>> randpy.address()
'194 Country Ln.'
>>> generators.email()
'frank@aol.org'
>>> generators.email()
'kiara@aol.com'
>>> generators.city()
'Vancouver'
>>> generators.city()
'Chicago'
>>> generators.state()
'Rhode Island'
>>> generators.state(abbrev=True)
'RI'
>>> generators.province()
'Alberta'
>>> generators.province(abbrev=True)
'AB'
>>> generators.lorem_ipsum()
'Lorem ipsum dolor sit amet...'
>>> generators.first_name()
'Lucia'
>>> generators.last_name()
'Rossi'
>>> generators.full_name()
'Theo Santos'
>>> generators.url()
'https://www.wordpress.org'
Release files for randpy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| randpy-0.1.1.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| randpy-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 17.6 kB
Release files / randpy-0.1.1.tar.gz
| Download URL | randpy-0.1.1.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14ff55cada173a9e102f4309a7109e4507080312f5fcc9e910f04c13a0ee7c95
|
|
BLAKE2b-256 checksum How to use checksums |
1e401d628a09cabae32266001aeb6ee07046b52bb3bd6c5310e031b65772076d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / randpy-0.1.1-py2.py3-none-any.whl
| Download URL | randpy-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
475f826ee35e35cd938d4af5fbb30485521a42f42ad4f26cd8fac6e722932d3c
|
|
BLAKE2b-256 checksum How to use checksums |
9de004d5bdc60ac83deadc596349fe4f2506a0ffe4ee3dac9bd5534d51fc5267
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |