Skip to main content

Tiny set of utilities to generate random data

Project description

Travis CI Coverage

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'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for randpy, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size randpy-0.1.1-py2.py3-none-any.whl (10.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size randpy-0.1.1.tar.gz (6.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page