Skip to content

kovrr/chancepy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

ChancePy - Random generator helper for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages