Random generator helper for Python
Project description
ChancePy
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_int = Chance.int(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!
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
chancepy-0.1.4.tar.gz
(4.9 kB
view details)
Built Distribution
File details
Details for the file chancepy-0.1.4.tar.gz
.
File metadata
- Download URL: chancepy-0.1.4.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.9 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7b22d32baf6a7568a0ed90d26913b0d1b2cac2e0f5c6c931ca01660066a1c56 |
|
MD5 | 393d41ed9d86eeadf4aa0a140edda4b6 |
|
BLAKE2b-256 | 3db4f14d4a6499001c7c630d10dc63bea59c32461e13c73c4e597f828ec5c790 |
File details
Details for the file chancepy-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: chancepy-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.9 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5e4636b7dcf7c3085036f0429a1ced9d465a17a865294aec1bba1ca133f0f99 |
|
MD5 | e765369bf15111adc535de5f7b8788d3 |
|
BLAKE2b-256 | 3c8d4555df5bc9ee32bc977174d5cf425c1259adfcaf35329e53b2d9239c28cf |