Skip to content

Commit ac8c33d

Browse files
committed
feat: update __init__.py to improve the structure and accessibility of PseudoRandom functions + prepared for release
1 parent 17c23ae commit ac8c33d

1 file changed

Lines changed: 66 additions & 1 deletion

File tree

pycustomrand/__init__.py

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,68 @@
11
# Делает класс PseudoRandom доступным при импорте пакета
2-
# Пример: from pycustomrand import PseudoRandom
32
from .random_generator import PseudoRandom
3+
4+
# Версия пакета
5+
__version__ = "0.0.1"
6+
7+
8+
# -------------------- Алиасы --------------------
9+
10+
# Основные функции
11+
set_seed = PseudoRandom.set_seed
12+
gen_random_number = PseudoRandom.gen_random_number
13+
random = PseudoRandom.random
14+
15+
# Целые числа
16+
randrange = PseudoRandom.randrange
17+
random_integer = PseudoRandom.random_integer
18+
randint = PseudoRandom.random_integer
19+
20+
# Числа с плавающей точкой
21+
random_float = PseudoRandom.random_float
22+
23+
# Байтовые функции
24+
random_bytes = PseudoRandom.random_bytes
25+
26+
# Последовательности
27+
choice = PseudoRandom.choice
28+
choices = PseudoRandom.choices
29+
shuffle = PseudoRandom.shuffle
30+
sample = PseudoRandom.sample
31+
32+
# Распределения
33+
triangular = PseudoRandom.triangular
34+
gauss = PseudoRandom.gauss
35+
expovariate = PseudoRandom.expovariate
36+
binomial = PseudoRandom.binomialvariate
37+
38+
# Утилиты
39+
random_bool = PseudoRandom.random_bool
40+
random_uuid4 = PseudoRandom.random_uuid4
41+
random_color_hex = PseudoRandom.random_color_hex
42+
43+
# ------------------------------------------------
44+
45+
# Для "from pycustomrand import *"
46+
__all__ = [
47+
"PseudoRandom",
48+
"true_round",
49+
"random",
50+
"set_seed",
51+
"gen_random_number",
52+
"randrange",
53+
"random_integer",
54+
"randint",
55+
"random_float",
56+
"random_bytes",
57+
"choice",
58+
"choices",
59+
"shuffle",
60+
"sample",
61+
"triangular",
62+
"gauss",
63+
"expovariate",
64+
"binomial",
65+
"random_bool",
66+
"random_uuid4",
67+
"random_color_hex"
68+
]

0 commit comments

Comments
 (0)