chancepy

Random generator helper for Python


License
MIT
Install
pip install chancepy==0.1.1

Documentation

ChancePy

Code style: black Actions Status License: MIT pypi

ChancePy - Random generator helper for Python. Inspired by ChanceJS.

Installation

with pip

pip install chancepy

with poetry

poetry add chancepy

Usage

from chancepy import Chance

# Basic Methods
rand_string = Chance.string()
rand_guid = Chance.guid()
rand_integer = Chance.integer(min=2, max=32)
rand_letter = Chance.letter(casing='lower')
rand_char = Chance.character(pool='acegikmoqsuwy')
rand_domain = Chance.domain()


# Utilities
rand_choice = Chance.pickone([1, 2, 3])
rand_2_choices = Chance.pickset(['a', 'b', 'c', 'd'], 2)

# Time
rand_date_in_april = Chance.date(month=4)
rand_year = Chance.year(mini=1990)
rand_month_name = Chance.month(mode="full")
rand_weekday = Chance.weekday(mode="short")
rand_hour = Chance.hour()
rand_min = Chance.minute()
rand_second = Chance.second()
rand_millisecond = Chance.millisecond()
rand_timezone = Chance.timezone()
rand_timestamp = Chance.timestamp()

Contributing

PRs are welcome!