umt-python 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- umt_python/__init__.py +443 -16
- {umt_python-0.1.1.dist-info → umt_python-0.2.0.dist-info}/METADATA +4 -3
- umt_python-0.2.0.dist-info/RECORD +6 -0
- {umt_python-0.1.1.dist-info → umt_python-0.2.0.dist-info}/WHEEL +1 -1
- umt_python/delete_spaces.py +0 -20
- umt_python/format_string.py +0 -32
- umt_python/from_base64.py +0 -27
- umt_python/has_no_letters.py +0 -22
- umt_python/pad_end.py +0 -29
- umt_python/pad_start.py +0 -36
- umt_python/random_string.py +0 -31
- umt_python/random_string_initialization.py +0 -33
- umt_python/reverse_string.py +0 -17
- umt_python/to_base64.py +0 -18
- umt_python/to_half_width.py +0 -32
- umt_python/trim_characters.py +0 -22
- umt_python/trim_end_characters.py +0 -23
- umt_python/trim_start_characters.py +0 -23
- umt_python-0.1.1.dist-info/RECORD +0 -20
- {umt_python-0.1.1.dist-info → umt_python-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {umt_python-0.1.1.dist-info → umt_python-0.2.0.dist-info}/top_level.txt +0 -0
umt_python/__init__.py
CHANGED
|
@@ -1,32 +1,459 @@
|
|
|
1
|
-
from .
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
from .array import (
|
|
2
|
+
ValidatedSortRange,
|
|
3
|
+
apply_insertion_sort_if_needed,
|
|
4
|
+
array_sum,
|
|
5
|
+
arrays_join,
|
|
6
|
+
binary_search,
|
|
7
|
+
check_flag_alignment,
|
|
8
|
+
chunk,
|
|
9
|
+
compact,
|
|
10
|
+
compare_function_default,
|
|
11
|
+
drop,
|
|
12
|
+
dual_pivot_quick_sort,
|
|
13
|
+
first,
|
|
14
|
+
generate_number_array,
|
|
15
|
+
get_arrays_common,
|
|
16
|
+
get_arrays_diff,
|
|
17
|
+
group_by,
|
|
18
|
+
insertion_sort,
|
|
19
|
+
insertion_sort_range,
|
|
20
|
+
key_by,
|
|
21
|
+
merge_sort,
|
|
22
|
+
pop,
|
|
23
|
+
quick_sort,
|
|
24
|
+
random_select,
|
|
25
|
+
range_array,
|
|
26
|
+
shuffle,
|
|
27
|
+
shuffle_2d_array,
|
|
28
|
+
tim_sort,
|
|
29
|
+
ultra_number_sort,
|
|
30
|
+
uniq_by,
|
|
31
|
+
unique,
|
|
32
|
+
validate_range,
|
|
33
|
+
zip_arrays,
|
|
34
|
+
zip_longest,
|
|
35
|
+
)
|
|
36
|
+
from .color import (
|
|
37
|
+
cmyk_to_rgba,
|
|
38
|
+
hexa_to_rgba,
|
|
39
|
+
hsla_to_rgba,
|
|
40
|
+
rgba_to_cmyk,
|
|
41
|
+
rgba_to_hexa,
|
|
42
|
+
rgba_to_hsla,
|
|
43
|
+
)
|
|
44
|
+
from .consts import (
|
|
45
|
+
ONE_DAY_MS,
|
|
46
|
+
ONE_HOUR_MS,
|
|
47
|
+
ONE_MINUTE_MS,
|
|
48
|
+
ONE_MONTH_MS,
|
|
49
|
+
ONE_MONTH_MS_28,
|
|
50
|
+
ONE_MONTH_MS_29,
|
|
51
|
+
ONE_MONTH_MS_31,
|
|
52
|
+
ONE_SECOND_MS,
|
|
53
|
+
ONE_WEEK_MS,
|
|
54
|
+
ONE_YEAR_MS,
|
|
55
|
+
ONE_YEAR_MS_366,
|
|
56
|
+
HttpClientErrorStatus,
|
|
57
|
+
HttpInformationalStatus,
|
|
58
|
+
HttpRedirectionStatus,
|
|
59
|
+
HttpServerErrorStatus,
|
|
60
|
+
HttpSuccessStatus,
|
|
61
|
+
)
|
|
62
|
+
from .crypto import (
|
|
63
|
+
decode_base32,
|
|
64
|
+
decode_base32_to_string,
|
|
65
|
+
decode_base58,
|
|
66
|
+
decode_base58_to_string,
|
|
67
|
+
encode_base32,
|
|
68
|
+
encode_base58,
|
|
69
|
+
)
|
|
70
|
+
from .data_structure import (
|
|
71
|
+
PriorityQueue,
|
|
72
|
+
)
|
|
73
|
+
from .date import (
|
|
74
|
+
DAY_LIST,
|
|
75
|
+
birthday,
|
|
76
|
+
date_format,
|
|
77
|
+
date_now,
|
|
78
|
+
date_range,
|
|
79
|
+
day_of_week,
|
|
80
|
+
get_day,
|
|
81
|
+
get_timezone_offset_string,
|
|
82
|
+
is_leap_year,
|
|
83
|
+
new_date_int,
|
|
84
|
+
new_date_string,
|
|
85
|
+
)
|
|
86
|
+
from .error import (
|
|
87
|
+
Error,
|
|
88
|
+
Result,
|
|
89
|
+
Success,
|
|
90
|
+
retry,
|
|
91
|
+
safe_execute,
|
|
92
|
+
)
|
|
93
|
+
from .function import (
|
|
94
|
+
curry,
|
|
95
|
+
)
|
|
96
|
+
from .ip import (
|
|
97
|
+
cidr_to_long,
|
|
98
|
+
cidr_to_subnet_mask,
|
|
99
|
+
get_ip_class,
|
|
100
|
+
get_network_address,
|
|
101
|
+
ip_to_binary_string,
|
|
102
|
+
ip_to_long,
|
|
103
|
+
is_in_range,
|
|
104
|
+
is_private_ip,
|
|
105
|
+
long_to_ip,
|
|
106
|
+
subnet_mask_to_cidr,
|
|
107
|
+
)
|
|
108
|
+
from .iterator import (
|
|
109
|
+
lazy_filter,
|
|
110
|
+
lazy_map,
|
|
111
|
+
lazy_take,
|
|
112
|
+
)
|
|
113
|
+
from .math import (
|
|
114
|
+
PrimeFactor,
|
|
115
|
+
ProbabilityFraction,
|
|
116
|
+
ReducedFraction,
|
|
117
|
+
addition,
|
|
118
|
+
average,
|
|
119
|
+
bitwise,
|
|
120
|
+
correlation_coefficient,
|
|
121
|
+
deg_to_rad,
|
|
122
|
+
deviation_value,
|
|
123
|
+
division,
|
|
124
|
+
factorial,
|
|
125
|
+
factorize,
|
|
126
|
+
flexible_number_conversion,
|
|
127
|
+
gcd,
|
|
128
|
+
get_decimal_length,
|
|
129
|
+
is_double,
|
|
130
|
+
is_perfect_square,
|
|
131
|
+
is_prime_number,
|
|
132
|
+
lcm,
|
|
133
|
+
linear_congruential_generator,
|
|
134
|
+
math_converter,
|
|
135
|
+
math_separator,
|
|
136
|
+
max_value,
|
|
137
|
+
median,
|
|
138
|
+
min_value,
|
|
139
|
+
mode,
|
|
140
|
+
multiples,
|
|
141
|
+
multiplication,
|
|
142
|
+
n_cr,
|
|
143
|
+
n_hr,
|
|
144
|
+
n_pr,
|
|
145
|
+
percentile,
|
|
146
|
+
prime_factorization,
|
|
147
|
+
quotient,
|
|
148
|
+
rad_to_deg,
|
|
149
|
+
random_int,
|
|
150
|
+
reduce_fraction,
|
|
151
|
+
repeated_trial,
|
|
152
|
+
round_of,
|
|
153
|
+
solve_equation,
|
|
154
|
+
standard_deviation,
|
|
155
|
+
subtraction,
|
|
156
|
+
to_base_n,
|
|
157
|
+
uuidv7,
|
|
158
|
+
value_swap,
|
|
159
|
+
xoshiro256,
|
|
160
|
+
)
|
|
161
|
+
from .number import (
|
|
162
|
+
to_ordinal,
|
|
163
|
+
)
|
|
164
|
+
from .object import (
|
|
165
|
+
object_has,
|
|
166
|
+
object_is_empty,
|
|
167
|
+
object_map_values,
|
|
168
|
+
object_merge,
|
|
169
|
+
object_merge_deep,
|
|
170
|
+
object_omit,
|
|
171
|
+
object_pick,
|
|
172
|
+
object_pick_deep,
|
|
173
|
+
)
|
|
174
|
+
from .predicate import (
|
|
175
|
+
every,
|
|
176
|
+
)
|
|
177
|
+
from .simple.math import (
|
|
178
|
+
deviation_value_simple,
|
|
179
|
+
)
|
|
180
|
+
from .string import (
|
|
181
|
+
DEFAULT_RANDOM_STRING_CHARS,
|
|
182
|
+
HTML_ESCAPE_MAP,
|
|
183
|
+
HTML_UNESCAPE_MAP,
|
|
184
|
+
FuzzySearchResult,
|
|
185
|
+
camel_case,
|
|
186
|
+
delete_spaces,
|
|
187
|
+
escape_html,
|
|
188
|
+
format_string,
|
|
189
|
+
from_base64,
|
|
190
|
+
fuzzy_search,
|
|
191
|
+
has_no_letters,
|
|
192
|
+
kebab_case,
|
|
193
|
+
levenshtein_distance,
|
|
194
|
+
pad_end,
|
|
195
|
+
pad_start,
|
|
196
|
+
random_string,
|
|
197
|
+
random_string_initialization,
|
|
198
|
+
reverse_string,
|
|
199
|
+
slugify,
|
|
200
|
+
string_similarity,
|
|
201
|
+
to_base64,
|
|
202
|
+
to_half_width,
|
|
203
|
+
trim_characters,
|
|
204
|
+
trim_end_characters,
|
|
205
|
+
trim_start_characters,
|
|
206
|
+
truncate,
|
|
207
|
+
unescape_html,
|
|
208
|
+
)
|
|
209
|
+
from .time import (
|
|
210
|
+
convert_time,
|
|
211
|
+
normalize_time_unit,
|
|
212
|
+
)
|
|
213
|
+
from .tool import (
|
|
214
|
+
Pipe,
|
|
215
|
+
Pipeline,
|
|
216
|
+
create_pipeline,
|
|
217
|
+
parse_json,
|
|
218
|
+
pipe,
|
|
219
|
+
)
|
|
220
|
+
from .ua import (
|
|
221
|
+
extract_browser_from_user_agent,
|
|
222
|
+
extract_device_from_user_agent,
|
|
223
|
+
extract_os_from_user_agent,
|
|
224
|
+
parse_user_agent,
|
|
225
|
+
)
|
|
226
|
+
from .unit import (
|
|
227
|
+
to_celsius,
|
|
228
|
+
to_kelvin,
|
|
229
|
+
unit_converter_initialization,
|
|
230
|
+
)
|
|
231
|
+
from .url import (
|
|
232
|
+
is_absolute_url,
|
|
233
|
+
join_path,
|
|
234
|
+
)
|
|
235
|
+
from .validate import (
|
|
236
|
+
EmailParts,
|
|
237
|
+
IsDeepEqualOptions,
|
|
238
|
+
ParseEmailLevel,
|
|
239
|
+
ParseEmailOptions,
|
|
240
|
+
ParseEmailResult,
|
|
241
|
+
is_array,
|
|
242
|
+
is_deep_equal,
|
|
243
|
+
is_dictionary_object,
|
|
244
|
+
is_equal,
|
|
245
|
+
is_not_empty,
|
|
246
|
+
is_number,
|
|
247
|
+
is_string,
|
|
248
|
+
is_value_nan,
|
|
249
|
+
parse_email,
|
|
250
|
+
)
|
|
15
251
|
|
|
16
252
|
__all__ = [
|
|
253
|
+
"DAY_LIST",
|
|
254
|
+
"DEFAULT_RANDOM_STRING_CHARS",
|
|
255
|
+
"HTML_ESCAPE_MAP",
|
|
256
|
+
"HTML_UNESCAPE_MAP",
|
|
257
|
+
"ONE_DAY_MS",
|
|
258
|
+
"ONE_HOUR_MS",
|
|
259
|
+
"ONE_MINUTE_MS",
|
|
260
|
+
"ONE_MONTH_MS",
|
|
261
|
+
"ONE_MONTH_MS_28",
|
|
262
|
+
"ONE_MONTH_MS_29",
|
|
263
|
+
"ONE_MONTH_MS_31",
|
|
264
|
+
"ONE_SECOND_MS",
|
|
265
|
+
"ONE_WEEK_MS",
|
|
266
|
+
"ONE_YEAR_MS",
|
|
267
|
+
"ONE_YEAR_MS_366",
|
|
268
|
+
"EmailParts",
|
|
269
|
+
"Error",
|
|
270
|
+
"FuzzySearchResult",
|
|
271
|
+
"HttpClientErrorStatus",
|
|
272
|
+
"HttpInformationalStatus",
|
|
273
|
+
"HttpRedirectionStatus",
|
|
274
|
+
"HttpServerErrorStatus",
|
|
275
|
+
"HttpSuccessStatus",
|
|
276
|
+
"IsDeepEqualOptions",
|
|
277
|
+
"ParseEmailLevel",
|
|
278
|
+
"ParseEmailOptions",
|
|
279
|
+
"ParseEmailResult",
|
|
280
|
+
"Pipe",
|
|
281
|
+
"Pipeline",
|
|
282
|
+
"PrimeFactor",
|
|
283
|
+
"PriorityQueue",
|
|
284
|
+
"ProbabilityFraction",
|
|
285
|
+
"ReducedFraction",
|
|
286
|
+
"Result",
|
|
287
|
+
"Success",
|
|
288
|
+
"ValidatedSortRange",
|
|
289
|
+
"addition",
|
|
290
|
+
"apply_insertion_sort_if_needed",
|
|
291
|
+
"array_sum",
|
|
292
|
+
"arrays_join",
|
|
293
|
+
"average",
|
|
294
|
+
"binary_search",
|
|
295
|
+
"birthday",
|
|
296
|
+
"bitwise",
|
|
297
|
+
"camel_case",
|
|
298
|
+
"check_flag_alignment",
|
|
299
|
+
"chunk",
|
|
300
|
+
"cidr_to_long",
|
|
301
|
+
"cidr_to_subnet_mask",
|
|
302
|
+
"cmyk_to_rgba",
|
|
303
|
+
"compact",
|
|
304
|
+
"compare_function_default",
|
|
305
|
+
"convert_time",
|
|
306
|
+
"correlation_coefficient",
|
|
307
|
+
"create_pipeline",
|
|
308
|
+
"curry",
|
|
309
|
+
"date_format",
|
|
310
|
+
"date_now",
|
|
311
|
+
"date_range",
|
|
312
|
+
"day_of_week",
|
|
313
|
+
"decode_base32",
|
|
314
|
+
"decode_base32_to_string",
|
|
315
|
+
"decode_base58",
|
|
316
|
+
"decode_base58_to_string",
|
|
317
|
+
"deg_to_rad",
|
|
17
318
|
"delete_spaces",
|
|
319
|
+
"deviation_value",
|
|
320
|
+
"deviation_value_simple",
|
|
321
|
+
"division",
|
|
322
|
+
"drop",
|
|
323
|
+
"dual_pivot_quick_sort",
|
|
324
|
+
"encode_base32",
|
|
325
|
+
"encode_base58",
|
|
326
|
+
"escape_html",
|
|
327
|
+
"every",
|
|
328
|
+
"extract_browser_from_user_agent",
|
|
329
|
+
"extract_device_from_user_agent",
|
|
330
|
+
"extract_os_from_user_agent",
|
|
331
|
+
"factorial",
|
|
332
|
+
"factorize",
|
|
333
|
+
"first",
|
|
334
|
+
"flexible_number_conversion",
|
|
18
335
|
"format_string",
|
|
19
336
|
"from_base64",
|
|
20
|
-
"
|
|
337
|
+
"fuzzy_search",
|
|
338
|
+
"gcd",
|
|
339
|
+
"generate_number_array",
|
|
340
|
+
"get_arrays_common",
|
|
341
|
+
"get_arrays_diff",
|
|
342
|
+
"get_day",
|
|
343
|
+
"get_decimal_length",
|
|
344
|
+
"get_ip_class",
|
|
345
|
+
"get_network_address",
|
|
346
|
+
"get_timezone_offset_string",
|
|
347
|
+
"group_by",
|
|
21
348
|
"has_no_letters",
|
|
349
|
+
"hexa_to_rgba",
|
|
350
|
+
"hsla_to_rgba",
|
|
351
|
+
"insertion_sort",
|
|
352
|
+
"insertion_sort_range",
|
|
353
|
+
"ip_to_binary_string",
|
|
354
|
+
"ip_to_long",
|
|
355
|
+
"is_absolute_url",
|
|
356
|
+
"is_array",
|
|
357
|
+
"is_deep_equal",
|
|
358
|
+
"is_dictionary_object",
|
|
359
|
+
"is_double",
|
|
360
|
+
"is_equal",
|
|
361
|
+
"is_in_range",
|
|
362
|
+
"is_leap_year",
|
|
363
|
+
"is_not_empty",
|
|
364
|
+
"is_number",
|
|
365
|
+
"is_perfect_square",
|
|
366
|
+
"is_prime_number",
|
|
367
|
+
"is_private_ip",
|
|
368
|
+
"is_string",
|
|
369
|
+
"is_value_nan",
|
|
370
|
+
"join_path",
|
|
371
|
+
"kebab_case",
|
|
372
|
+
"key_by",
|
|
373
|
+
"lazy_filter",
|
|
374
|
+
"lazy_map",
|
|
375
|
+
"lazy_take",
|
|
376
|
+
"lcm",
|
|
377
|
+
"levenshtein_distance",
|
|
378
|
+
"linear_congruential_generator",
|
|
379
|
+
"long_to_ip",
|
|
380
|
+
"math_converter",
|
|
381
|
+
"math_separator",
|
|
382
|
+
"max_value",
|
|
383
|
+
"median",
|
|
384
|
+
"merge_sort",
|
|
385
|
+
"min_value",
|
|
386
|
+
"mode",
|
|
387
|
+
"multiples",
|
|
388
|
+
"multiplication",
|
|
389
|
+
"n_cr",
|
|
390
|
+
"n_hr",
|
|
391
|
+
"n_pr",
|
|
392
|
+
"new_date_int",
|
|
393
|
+
"new_date_string",
|
|
394
|
+
"normalize_time_unit",
|
|
395
|
+
"object_has",
|
|
396
|
+
"object_is_empty",
|
|
397
|
+
"object_map_values",
|
|
398
|
+
"object_merge",
|
|
399
|
+
"object_merge_deep",
|
|
400
|
+
"object_omit",
|
|
401
|
+
"object_pick",
|
|
402
|
+
"object_pick_deep",
|
|
22
403
|
"pad_end",
|
|
23
404
|
"pad_start",
|
|
405
|
+
"parse_email",
|
|
406
|
+
"parse_json",
|
|
407
|
+
"parse_user_agent",
|
|
408
|
+
"percentile",
|
|
409
|
+
"pipe",
|
|
410
|
+
"pop",
|
|
411
|
+
"prime_factorization",
|
|
412
|
+
"quick_sort",
|
|
413
|
+
"quotient",
|
|
414
|
+
"rad_to_deg",
|
|
415
|
+
"random_int",
|
|
416
|
+
"random_select",
|
|
24
417
|
"random_string",
|
|
25
|
-
"DEFAULT_RANDOM_STRING_CHARS",
|
|
26
418
|
"random_string_initialization",
|
|
419
|
+
"range_array",
|
|
420
|
+
"reduce_fraction",
|
|
421
|
+
"repeated_trial",
|
|
422
|
+
"retry",
|
|
27
423
|
"reverse_string",
|
|
424
|
+
"rgba_to_cmyk",
|
|
425
|
+
"rgba_to_hexa",
|
|
426
|
+
"rgba_to_hsla",
|
|
427
|
+
"round_of",
|
|
428
|
+
"safe_execute",
|
|
429
|
+
"shuffle",
|
|
430
|
+
"shuffle_2d_array",
|
|
431
|
+
"slugify",
|
|
432
|
+
"solve_equation",
|
|
433
|
+
"standard_deviation",
|
|
434
|
+
"string_similarity",
|
|
435
|
+
"subnet_mask_to_cidr",
|
|
436
|
+
"subtraction",
|
|
437
|
+
"tim_sort",
|
|
438
|
+
"to_base64",
|
|
439
|
+
"to_base_n",
|
|
440
|
+
"to_celsius",
|
|
28
441
|
"to_half_width",
|
|
442
|
+
"to_kelvin",
|
|
443
|
+
"to_ordinal",
|
|
29
444
|
"trim_characters",
|
|
30
445
|
"trim_end_characters",
|
|
31
446
|
"trim_start_characters",
|
|
447
|
+
"truncate",
|
|
448
|
+
"ultra_number_sort",
|
|
449
|
+
"unescape_html",
|
|
450
|
+
"uniq_by",
|
|
451
|
+
"unique",
|
|
452
|
+
"unit_converter_initialization",
|
|
453
|
+
"uuidv7",
|
|
454
|
+
"validate_range",
|
|
455
|
+
"value_swap",
|
|
456
|
+
"xoshiro256",
|
|
457
|
+
"zip_arrays",
|
|
458
|
+
"zip_longest",
|
|
32
459
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: umt_python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: A collection of useful utility functions for various tasks in Python, focusing on string manipulation and formatting.
|
|
5
5
|
Author-email: riya-amemiya <riyaamemiya@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,14 +8,15 @@ Project-URL: Bug Tracker, https://github.com/riya-amemiya/UMT/issues
|
|
|
8
8
|
Project-URL: Homepage, https://github.com/riya-amemiya/UMT
|
|
9
9
|
Project-URL: Repository, https://github.com/riya-amemiya/UMT
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
16
|
Classifier: Operating System :: OS Independent
|
|
16
17
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
18
|
Classifier: Topic :: Utilities
|
|
18
|
-
Requires-Python: >=3.
|
|
19
|
+
Requires-Python: >=3.10
|
|
19
20
|
Description-Content-Type: text/markdown
|
|
20
21
|
License-File: LICENSE
|
|
21
22
|
Dynamic: license-file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
umt_python/__init__.py,sha256=Q46wkUI6c2atLpR1qqIGhQqbtvXWDbV75ywUaVwgSIw,8737
|
|
2
|
+
umt_python-0.2.0.dist-info/licenses/LICENSE,sha256=1sfH4YyDPcU1Flbmf9AwxZHlsxt0bMsoU7TpSvVPaTo,1069
|
|
3
|
+
umt_python-0.2.0.dist-info/METADATA,sha256=koT12tuAdfDtqCsJbmAaGeIUH-_3_kP_XkFgC2zl22Q,5164
|
|
4
|
+
umt_python-0.2.0.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
|
|
5
|
+
umt_python-0.2.0.dist-info/top_level.txt,sha256=JMzQArGg6QV0n-BiGlvfXempE7t93p2i0-2bH3XUkEk,11
|
|
6
|
+
umt_python-0.2.0.dist-info/RECORD,,
|
umt_python/delete_spaces.py
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import re
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def delete_spaces(string_: str) -> str:
|
|
5
|
-
"""
|
|
6
|
-
Removes all whitespace characters from a string.
|
|
7
|
-
|
|
8
|
-
Args:
|
|
9
|
-
string_: Input string.
|
|
10
|
-
|
|
11
|
-
Returns:
|
|
12
|
-
String with all whitespace characters removed.
|
|
13
|
-
|
|
14
|
-
Example:
|
|
15
|
-
>>> delete_spaces("Hello World")
|
|
16
|
-
'HelloWorld'
|
|
17
|
-
>>> delete_spaces(" tab\\t space ")
|
|
18
|
-
'tabspace'
|
|
19
|
-
"""
|
|
20
|
-
return re.sub(r"\s", "", string_)
|
umt_python/format_string.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import re
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def format_string(template: str, *values: object) -> str:
|
|
5
|
-
"""
|
|
6
|
-
Replaces placeholders in a template string with specified values.
|
|
7
|
-
Placeholders are in the format {0}, {1}, {2}... and corresponding
|
|
8
|
-
values are passed as arguments.
|
|
9
|
-
|
|
10
|
-
Args:
|
|
11
|
-
template: Template string containing placeholders.
|
|
12
|
-
*values: Values to replace the placeholders in the template.
|
|
13
|
-
|
|
14
|
-
Returns:
|
|
15
|
-
String with placeholders replaced with values.
|
|
16
|
-
|
|
17
|
-
Example:
|
|
18
|
-
>>> format_string("Hello, {0}!", "World")
|
|
19
|
-
'Hello, World!'
|
|
20
|
-
>>> format_string("The sum of {0} and {1} is {2}.", 1, 2, 3)
|
|
21
|
-
'The sum of 1 and 2 is 3.'
|
|
22
|
-
>>> format_string("Not enough values: {0} {1}", "val1") # Mimics TS behavior
|
|
23
|
-
'Not enough values: val1 {1}'
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
def replace(match):
|
|
27
|
-
index = int(match.group(1))
|
|
28
|
-
if index < len(values):
|
|
29
|
-
return str(values[index])
|
|
30
|
-
return match.group(0) # Return the original placeholder if value not found
|
|
31
|
-
|
|
32
|
-
return re.sub(r"{(\d+)}", replace, template)
|
umt_python/from_base64.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import base64
|
|
2
|
-
import binascii
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def from_base64(base64_string: str) -> str:
|
|
6
|
-
"""
|
|
7
|
-
Converts Base64 to string.
|
|
8
|
-
|
|
9
|
-
Args:
|
|
10
|
-
base64_string: Base64 encoded string.
|
|
11
|
-
|
|
12
|
-
Returns:
|
|
13
|
-
Decoded string from Base64.
|
|
14
|
-
|
|
15
|
-
Raises:
|
|
16
|
-
ValueError: When input is not a valid Base64 string.
|
|
17
|
-
|
|
18
|
-
Example:
|
|
19
|
-
>>> from_base64("SGVsbG8gV29ybGQ=")
|
|
20
|
-
'Hello World'
|
|
21
|
-
"""
|
|
22
|
-
if not base64_string:
|
|
23
|
-
return ""
|
|
24
|
-
try:
|
|
25
|
-
return base64.b64decode(base64_string.encode("utf-8")).decode("utf-8")
|
|
26
|
-
except (binascii.Error, UnicodeDecodeError) as e:
|
|
27
|
-
raise ValueError("Invalid Base64 string") from e
|
umt_python/has_no_letters.py
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
def has_no_letters(text: str) -> bool:
|
|
2
|
-
"""
|
|
3
|
-
Checks if the string contains no letters (contains only emojis, numbers, or special characters).
|
|
4
|
-
|
|
5
|
-
Args:
|
|
6
|
-
text: The string to check.
|
|
7
|
-
|
|
8
|
-
Returns:
|
|
9
|
-
True if the string has no letters, False otherwise.
|
|
10
|
-
|
|
11
|
-
Example:
|
|
12
|
-
>>> has_no_letters("123")
|
|
13
|
-
True
|
|
14
|
-
>>> has_no_letters("🌟123#")
|
|
15
|
-
True
|
|
16
|
-
>>> has_no_letters("abc123")
|
|
17
|
-
False
|
|
18
|
-
"""
|
|
19
|
-
for char_code in text:
|
|
20
|
-
if char_code.isalpha():
|
|
21
|
-
return False
|
|
22
|
-
return True
|
umt_python/pad_end.py
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
def pad_end(string_: str, target_length: int, pad_string: str) -> str:
|
|
2
|
-
"""
|
|
3
|
-
Adds the specified string to the end of the string until it reaches the specified length.
|
|
4
|
-
|
|
5
|
-
Args:
|
|
6
|
-
string_: The original string to apply padding.
|
|
7
|
-
target_length: The target length after padding.
|
|
8
|
-
pad_string: The string to use for padding.
|
|
9
|
-
|
|
10
|
-
Returns:
|
|
11
|
-
The string after padding has been applied.
|
|
12
|
-
|
|
13
|
-
Example:
|
|
14
|
-
>>> pad_end("abc", 5, "0")
|
|
15
|
-
'abc00'
|
|
16
|
-
>>> pad_end("hello", 8, "123")
|
|
17
|
-
'hello123'
|
|
18
|
-
>>> pad_end("world", 3, "!") # target_length is less than string length
|
|
19
|
-
'world'
|
|
20
|
-
>>> pad_end("test", 6, "") # pad_string is empty
|
|
21
|
-
'test'
|
|
22
|
-
"""
|
|
23
|
-
if not pad_string:
|
|
24
|
-
return string_
|
|
25
|
-
result = string_
|
|
26
|
-
while len(result) < target_length:
|
|
27
|
-
needed = target_length - len(result)
|
|
28
|
-
result += pad_string[:needed]
|
|
29
|
-
return result
|
umt_python/pad_start.py
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
def pad_start(string_: str, target_length: int, pad_string: str) -> str:
|
|
2
|
-
"""
|
|
3
|
-
Pads the start of a string with another string until the target length is reached.
|
|
4
|
-
|
|
5
|
-
Args:
|
|
6
|
-
string_: The original string to pad.
|
|
7
|
-
target_length: The target length after padding.
|
|
8
|
-
pad_string: The string to use for padding.
|
|
9
|
-
|
|
10
|
-
Returns:
|
|
11
|
-
The padded string.
|
|
12
|
-
|
|
13
|
-
Raises:
|
|
14
|
-
ValueError: If pad_string is empty.
|
|
15
|
-
|
|
16
|
-
Example:
|
|
17
|
-
>>> pad_start("123", 5, "0")
|
|
18
|
-
'00123'
|
|
19
|
-
>>> pad_start("abc", 8, "def")
|
|
20
|
-
'defdeabc'
|
|
21
|
-
>>> pad_start("world", 3, "!") # target_length is less than string length
|
|
22
|
-
'world'
|
|
23
|
-
"""
|
|
24
|
-
if not pad_string:
|
|
25
|
-
raise ValueError("pad_string cannot be empty")
|
|
26
|
-
|
|
27
|
-
if len(string_) >= target_length:
|
|
28
|
-
return string_
|
|
29
|
-
|
|
30
|
-
padding = ""
|
|
31
|
-
padding_length = target_length - len(string_)
|
|
32
|
-
|
|
33
|
-
while len(padding) < padding_length:
|
|
34
|
-
padding += pad_string
|
|
35
|
-
|
|
36
|
-
return padding[:padding_length] + string_
|
umt_python/random_string.py
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import random
|
|
2
|
-
import string
|
|
3
|
-
|
|
4
|
-
DEFAULT_RANDOM_STRING_CHARS = string.ascii_letters + string.digits
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def random_string(size: int = 8, char_pool: str = DEFAULT_RANDOM_STRING_CHARS) -> str:
|
|
8
|
-
"""
|
|
9
|
-
Generates a random string.
|
|
10
|
-
|
|
11
|
-
Args:
|
|
12
|
-
size: Length of the random string. Defaults to 8.
|
|
13
|
-
char_pool: String of characters to use for generating random string.
|
|
14
|
-
Defaults to alphanumeric characters.
|
|
15
|
-
|
|
16
|
-
Returns:
|
|
17
|
-
Random string.
|
|
18
|
-
|
|
19
|
-
Example:
|
|
20
|
-
>>> len(random_string()) == 8
|
|
21
|
-
True
|
|
22
|
-
>>> len(random_string(10)) == 10
|
|
23
|
-
True
|
|
24
|
-
>>> all(c in 'abc' for c in random_string(5, 'abc'))
|
|
25
|
-
True
|
|
26
|
-
"""
|
|
27
|
-
if size == 0:
|
|
28
|
-
return ""
|
|
29
|
-
# When char_pool is empty and size > 0, random.choice will raise IndexError.
|
|
30
|
-
# This is the expected behavior for the tests.
|
|
31
|
-
return "".join(random.choice(char_pool) for _ in range(size))
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
from typing import Callable
|
|
2
|
-
from .random_string import random_string, DEFAULT_RANDOM_STRING_CHARS
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def random_string_initialization(
|
|
6
|
-
char_pool: str = DEFAULT_RANDOM_STRING_CHARS,
|
|
7
|
-
) -> Callable[[int], str]:
|
|
8
|
-
"""
|
|
9
|
-
Initializes a function that generates random strings with a specific character pool.
|
|
10
|
-
|
|
11
|
-
Args:
|
|
12
|
-
char_pool: String of characters to use for generating random strings.
|
|
13
|
-
Defaults to alphanumeric characters.
|
|
14
|
-
|
|
15
|
-
Returns:
|
|
16
|
-
A function that generates random strings (size: int) -> str.
|
|
17
|
-
|
|
18
|
-
Example:
|
|
19
|
-
>>> from .random_string import DEFAULT_RANDOM_STRING_CHARS # For doctest
|
|
20
|
-
>>> custom_random = random_string_initialization("xyz")
|
|
21
|
-
>>> r_string = custom_random(3)
|
|
22
|
-
>>> len(r_string) == 3
|
|
23
|
-
True
|
|
24
|
-
>>> all(c in "xyz" for c in r_string)
|
|
25
|
-
True
|
|
26
|
-
>>> default_pool_func = random_string_initialization()
|
|
27
|
-
>>> another_string = default_pool_func(5)
|
|
28
|
-
>>> len(another_string) == 5
|
|
29
|
-
True
|
|
30
|
-
>>> all(c in DEFAULT_RANDOM_STRING_CHARS for c in another_string)
|
|
31
|
-
True
|
|
32
|
-
"""
|
|
33
|
-
return lambda size: random_string(size, char_pool)
|
umt_python/reverse_string.py
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
def reverse_string(char: str) -> str:
|
|
2
|
-
"""
|
|
3
|
-
Reverses a string.
|
|
4
|
-
|
|
5
|
-
Args:
|
|
6
|
-
char: String to reverse.
|
|
7
|
-
|
|
8
|
-
Returns:
|
|
9
|
-
Reversed string.
|
|
10
|
-
|
|
11
|
-
Example:
|
|
12
|
-
>>> reverse_string("Hello")
|
|
13
|
-
'olleH'
|
|
14
|
-
>>> reverse_string("madam")
|
|
15
|
-
'madam'
|
|
16
|
-
"""
|
|
17
|
-
return char[::-1]
|
umt_python/to_base64.py
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import base64
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def to_base64(char: str) -> str:
|
|
5
|
-
"""
|
|
6
|
-
Convert string to Base64.
|
|
7
|
-
|
|
8
|
-
Args:
|
|
9
|
-
char: String to convert to Base64.
|
|
10
|
-
|
|
11
|
-
Returns:
|
|
12
|
-
Base64 encoded string.
|
|
13
|
-
|
|
14
|
-
Example:
|
|
15
|
-
>>> to_base64("Hello World")
|
|
16
|
-
'SGVsbG8gV29ybGQ='
|
|
17
|
-
"""
|
|
18
|
-
return base64.b64encode(char.encode("utf-8")).decode("utf-8")
|
umt_python/to_half_width.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
def to_half_width(string_: str) -> str:
|
|
2
|
-
"""
|
|
3
|
-
Convert full-width characters (zenkaku) to half-width characters (hankaku).
|
|
4
|
-
This implementation specifically targets full-width alphanumeric characters and some symbols.
|
|
5
|
-
|
|
6
|
-
Args:
|
|
7
|
-
string_: String to convert.
|
|
8
|
-
|
|
9
|
-
Returns:
|
|
10
|
-
Converted string.
|
|
11
|
-
|
|
12
|
-
Example:
|
|
13
|
-
>>> to_half_width("Hello World 123")
|
|
14
|
-
'Hello World 123'
|
|
15
|
-
>>> to_half_width("ABCdef")
|
|
16
|
-
'ABCdef'
|
|
17
|
-
>>> to_half_width("!"#$%&'()*+,-./") # Full-width symbols
|
|
18
|
-
"!\"#$%&'()*+,-./"
|
|
19
|
-
>>> to_half_width(" ") # Full-width space
|
|
20
|
-
' '
|
|
21
|
-
"""
|
|
22
|
-
# Mapping for full-width to half-width for ASCII range based on Unicode block
|
|
23
|
-
# Full-width exclamation mark to tilde: U+FF01 to U+FF5E
|
|
24
|
-
# Half-width corresponding characters: U+0021 to U+007E
|
|
25
|
-
# The difference is 0xFEE0 (65248)
|
|
26
|
-
# Full-width space U+3000 -> Half-width space U+0020
|
|
27
|
-
translation_table = {}
|
|
28
|
-
for i in range(0xFF01, 0xFF5F): # Covers full-width '!' to '~'
|
|
29
|
-
translation_table[i] = i - 0xFEE0
|
|
30
|
-
translation_table[0x3000] = 0x0020 # Full-width space to half-width space
|
|
31
|
-
|
|
32
|
-
return string_.translate(translation_table)
|
umt_python/trim_characters.py
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
from .trim_start_characters import trim_start_characters
|
|
2
|
-
from .trim_end_characters import trim_end_characters
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def trim_characters(string_: str, chars: str) -> str:
|
|
6
|
-
"""
|
|
7
|
-
Removes specified characters from both ends of a string.
|
|
8
|
-
|
|
9
|
-
Args:
|
|
10
|
-
string_: The string to trim.
|
|
11
|
-
chars: The set of characters to remove.
|
|
12
|
-
|
|
13
|
-
Returns:
|
|
14
|
-
A new string with specified characters removed from both ends.
|
|
15
|
-
|
|
16
|
-
Example:
|
|
17
|
-
>>> trim_characters("-.-hello-.-", "-.")
|
|
18
|
-
'hello'
|
|
19
|
-
>>> trim_characters("123abc123", "123")
|
|
20
|
-
'abc'
|
|
21
|
-
"""
|
|
22
|
-
return trim_end_characters(trim_start_characters(string_, chars), chars)
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
def trim_end_characters(string_: str, chars: str) -> str:
|
|
2
|
-
"""
|
|
3
|
-
Removes specified characters from the end of a string.
|
|
4
|
-
|
|
5
|
-
Args:
|
|
6
|
-
string_: The input string to trim.
|
|
7
|
-
chars: Characters to remove from the end.
|
|
8
|
-
|
|
9
|
-
Returns:
|
|
10
|
-
A new string with specified characters removed from the end.
|
|
11
|
-
|
|
12
|
-
Example:
|
|
13
|
-
>>> trim_end_characters("hello!!!", "!")
|
|
14
|
-
'hello'
|
|
15
|
-
>>> trim_end_characters("123---", "-")
|
|
16
|
-
'123'
|
|
17
|
-
>>> trim_end_characters("abc123", "xyz")
|
|
18
|
-
'abc123'
|
|
19
|
-
"""
|
|
20
|
-
end_index = len(string_)
|
|
21
|
-
while end_index > 0 and string_[end_index - 1] in chars:
|
|
22
|
-
end_index -= 1
|
|
23
|
-
return string_[:end_index]
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
def trim_start_characters(string_: str, chars: str) -> str:
|
|
2
|
-
"""
|
|
3
|
-
Removes specified characters from the start of a string.
|
|
4
|
-
|
|
5
|
-
Args:
|
|
6
|
-
string_: The input string to trim.
|
|
7
|
-
chars: Characters to remove from the start.
|
|
8
|
-
|
|
9
|
-
Returns:
|
|
10
|
-
A new string with specified characters removed from the start.
|
|
11
|
-
|
|
12
|
-
Example:
|
|
13
|
-
>>> trim_start_characters("!!!hello", "!")
|
|
14
|
-
'hello'
|
|
15
|
-
>>> trim_start_characters("---123", "-")
|
|
16
|
-
'123'
|
|
17
|
-
>>> trim_start_characters("abc123", "xyz")
|
|
18
|
-
'abc123'
|
|
19
|
-
"""
|
|
20
|
-
start_index = 0
|
|
21
|
-
while start_index < len(string_) and string_[start_index] in chars:
|
|
22
|
-
start_index += 1
|
|
23
|
-
return string_[start_index:]
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
umt_python/__init__.py,sha256=VZz3TwQJokyFAjRLAkeQzTrmLIaax-uyc6sj_ZKHV4g,998
|
|
2
|
-
umt_python/delete_spaces.py,sha256=XuKvz33T9dSjlSF7YUbuNnGLVYQfs4oBIqoF8-v0c74,410
|
|
3
|
-
umt_python/format_string.py,sha256=QOAZWNZUkyS_H4h98S5NGjHbSoU61CN4IxKkzNnZ_sg,1050
|
|
4
|
-
umt_python/from_base64.py,sha256=ZWEFG3DpO4FL7CsBSa_xUyLbeo68JBgnQi-hr5X9g9o,627
|
|
5
|
-
umt_python/has_no_letters.py,sha256=U8hZMbwYMJzn07rljZiAIhndaUqhgZWKCocSwVmnZ9w,540
|
|
6
|
-
umt_python/pad_end.py,sha256=CIpIQeR3O0RmVFv_VBftzk7sOLSNtIgBe8ZH05jPkeA,917
|
|
7
|
-
umt_python/pad_start.py,sha256=0tuZ9lLXKwQNOVck6Ov_ZlwOgttY4F5DqS0pIGLCeUs,987
|
|
8
|
-
umt_python/random_string.py,sha256=gG6m7MdcnIDSfyCcqIYKulux3QRxYeMZrMNZRnwhpGk,898
|
|
9
|
-
umt_python/random_string_initialization.py,sha256=sRIHuTFTQJXZCM4Y24nN4SuTd26M1tN_R01ZMAXTA4A,1151
|
|
10
|
-
umt_python/reverse_string.py,sha256=zd5BrBeYy1PaglWnJMSDbZ7an2Ok2II4rORayZ2sGz4,300
|
|
11
|
-
umt_python/to_base64.py,sha256=nGWR2anOAwkOQyjXCdD5mZbahHjG_469s8nWzFgyU7c,338
|
|
12
|
-
umt_python/to_half_width.py,sha256=o6M0ChY5fpJo97ogoiroq9fkfohqxn5yuxhdqOn9Qvs,1252
|
|
13
|
-
umt_python/trim_characters.py,sha256=dU_G-PZKvM09eRQVjCJ--2rHmaetGHdj-jLcmjyXi60,642
|
|
14
|
-
umt_python/trim_end_characters.py,sha256=Cnr-tyjqoKB-hqIDV5PI0x1p2CleIyOGcIZ62hkwLMI,670
|
|
15
|
-
umt_python/trim_start_characters.py,sha256=TcGa9T3ArIIxguvYf8I2EJ1AUUN3AzYk1Y-0YYprBk8,690
|
|
16
|
-
umt_python-0.1.1.dist-info/licenses/LICENSE,sha256=1sfH4YyDPcU1Flbmf9AwxZHlsxt0bMsoU7TpSvVPaTo,1069
|
|
17
|
-
umt_python-0.1.1.dist-info/METADATA,sha256=J7pGHZbxPbQYsiBxrA43rTZIjwSPloslE7xAThE7_sA,5111
|
|
18
|
-
umt_python-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
-
umt_python-0.1.1.dist-info/top_level.txt,sha256=JMzQArGg6QV0n-BiGlvfXempE7t93p2i0-2bH3XUkEk,11
|
|
20
|
-
umt_python-0.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|