umt-python 0.1.1__tar.gz → 0.3.0__tar.gz
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-0.1.1/umt_python.egg-info → umt_python-0.3.0}/PKG-INFO +12 -3
- {umt_python-0.1.1 → umt_python-0.3.0}/README.md +8 -0
- {umt_python-0.1.1 → umt_python-0.3.0}/pyproject.toml +40 -10
- umt_python-0.3.0/src/__init__.py +783 -0
- {umt_python-0.1.1 → umt_python-0.3.0/umt_python.egg-info}/PKG-INFO +12 -3
- umt_python-0.3.0/umt_python.egg-info/SOURCES.txt +8 -0
- umt_python-0.1.1/src/__init__.py +0 -32
- umt_python-0.1.1/src/delete_spaces.py +0 -20
- umt_python-0.1.1/src/format_string.py +0 -32
- umt_python-0.1.1/src/from_base64.py +0 -27
- umt_python-0.1.1/src/has_no_letters.py +0 -22
- umt_python-0.1.1/src/pad_end.py +0 -29
- umt_python-0.1.1/src/pad_start.py +0 -36
- umt_python-0.1.1/src/random_string.py +0 -31
- umt_python-0.1.1/src/random_string_initialization.py +0 -33
- umt_python-0.1.1/src/reverse_string.py +0 -17
- umt_python-0.1.1/src/to_base64.py +0 -18
- umt_python-0.1.1/src/to_half_width.py +0 -32
- umt_python-0.1.1/src/trim_characters.py +0 -22
- umt_python-0.1.1/src/trim_end_characters.py +0 -23
- umt_python-0.1.1/src/trim_start_characters.py +0 -23
- umt_python-0.1.1/tests/test_string_utils.py +0 -435
- umt_python-0.1.1/umt_python.egg-info/SOURCES.txt +0 -23
- {umt_python-0.1.1 → umt_python-0.3.0}/LICENSE +0 -0
- {umt_python-0.1.1 → umt_python-0.3.0}/setup.cfg +0 -0
- {umt_python-0.1.1 → umt_python-0.3.0}/umt_python.egg-info/dependency_links.txt +0 -0
- {umt_python-0.1.1 → umt_python-0.3.0}/umt_python.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: umt_python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.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
|
|
@@ -100,6 +101,14 @@ print(encoded) # "SGVsbG8gV29ybGQ="
|
|
|
100
101
|
|----------|------|-------------|---------|
|
|
101
102
|
| `has_no_letters` | `(text: str) -> bool` | Check if string contains no letters (only numbers, emojis, special chars) | `has_no_letters("123!@#") # True` / `has_no_letters("abc123") # False` |
|
|
102
103
|
|
|
104
|
+
### Number Functions
|
|
105
|
+
|
|
106
|
+
| Function | Type | Description | Example |
|
|
107
|
+
|----------|------|-------------|---------|
|
|
108
|
+
| `format_number` | `(value: float \| int, *, locale: str \| None = None, minimum_fraction_digits: int \| None = None, maximum_fraction_digits: int \| None = None, style: Literal["decimal", "currency", "percent"] = "decimal", currency: str \| None = None) -> str` | Format a number with locale-aware separators, fraction-digit controls, and decimal/percent/currency styles. Mirrors `Intl.NumberFormat` from the TypeScript source. | `format_number(1234567.89) # "1,234,567.89"` / `format_number(1234567.89, locale="de-DE") # "1.234.567,89"` / `format_number(0.75, style="percent") # "75%"` / `format_number(1234.5, style="currency", currency="USD") # "$1,234.50"` |
|
|
109
|
+
| `to_ordinal` | `(value: int \| float) -> str` | Convert a number to its English ordinal string (handles 11th/12th/13th specially) | `to_ordinal(1) # "1st"` / `to_ordinal(11) # "11th"` / `to_ordinal(21) # "21st"` |
|
|
110
|
+
| `to_percentage` | `(value: float \| int, total: float \| int, decimals: int = 2) -> float` | Calculate the percentage of a value relative to a total (returns 0 when total is 0) | `to_percentage(1, 3) # 33.33` / `to_percentage(25, 100) # 25.0` |
|
|
111
|
+
|
|
103
112
|
## Constants
|
|
104
113
|
|
|
105
114
|
- `DEFAULT_RANDOM_STRING_CHARS`: Default character pool for random string generation (ASCII letters + digits)
|
|
@@ -78,6 +78,14 @@ print(encoded) # "SGVsbG8gV29ybGQ="
|
|
|
78
78
|
|----------|------|-------------|---------|
|
|
79
79
|
| `has_no_letters` | `(text: str) -> bool` | Check if string contains no letters (only numbers, emojis, special chars) | `has_no_letters("123!@#") # True` / `has_no_letters("abc123") # False` |
|
|
80
80
|
|
|
81
|
+
### Number Functions
|
|
82
|
+
|
|
83
|
+
| Function | Type | Description | Example |
|
|
84
|
+
|----------|------|-------------|---------|
|
|
85
|
+
| `format_number` | `(value: float \| int, *, locale: str \| None = None, minimum_fraction_digits: int \| None = None, maximum_fraction_digits: int \| None = None, style: Literal["decimal", "currency", "percent"] = "decimal", currency: str \| None = None) -> str` | Format a number with locale-aware separators, fraction-digit controls, and decimal/percent/currency styles. Mirrors `Intl.NumberFormat` from the TypeScript source. | `format_number(1234567.89) # "1,234,567.89"` / `format_number(1234567.89, locale="de-DE") # "1.234.567,89"` / `format_number(0.75, style="percent") # "75%"` / `format_number(1234.5, style="currency", currency="USD") # "$1,234.50"` |
|
|
86
|
+
| `to_ordinal` | `(value: int \| float) -> str` | Convert a number to its English ordinal string (handles 11th/12th/13th specially) | `to_ordinal(1) # "1st"` / `to_ordinal(11) # "11th"` / `to_ordinal(21) # "21st"` |
|
|
87
|
+
| `to_percentage` | `(value: float \| int, total: float \| int, decimals: int = 2) -> float` | Calculate the percentage of a value relative to a total (returns 0 when total is 0) | `to_percentage(1, 3) # 33.33` / `to_percentage(25, 100) # 25.0` |
|
|
88
|
+
|
|
81
89
|
## Constants
|
|
82
90
|
|
|
83
91
|
- `DEFAULT_RANDOM_STRING_CHARS`: Default character pool for random string generation (ASCII letters + digits)
|
|
@@ -3,19 +3,18 @@ build-backend = "setuptools.build_meta"
|
|
|
3
3
|
requires = ["setuptools>=61.0", "wheel"]
|
|
4
4
|
|
|
5
5
|
[tool.setuptools]
|
|
6
|
-
package-dir = {"umt_python" = "src"}
|
|
6
|
+
package-dir = { "umt_python" = "src" }
|
|
7
7
|
packages = ["umt_python"]
|
|
8
8
|
|
|
9
9
|
[project]
|
|
10
|
-
authors = [
|
|
11
|
-
{name = "riya-amemiya", email = "riyaamemiya@gmail.com"},
|
|
12
|
-
]
|
|
10
|
+
authors = [{ name = "riya-amemiya", email = "riyaamemiya@gmail.com" }]
|
|
13
11
|
classifiers = [
|
|
14
12
|
"Programming Language :: Python :: 3",
|
|
15
|
-
"Programming Language :: Python :: 3.9",
|
|
16
13
|
"Programming Language :: Python :: 3.10",
|
|
17
14
|
"Programming Language :: Python :: 3.11",
|
|
18
15
|
"Programming Language :: Python :: 3.12",
|
|
16
|
+
"Programming Language :: Python :: 3.13",
|
|
17
|
+
"Programming Language :: Python :: 3.14",
|
|
19
18
|
"Operating System :: OS Independent",
|
|
20
19
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
21
20
|
"Topic :: Utilities",
|
|
@@ -24,8 +23,8 @@ description = "A collection of useful utility functions for various tasks in Pyt
|
|
|
24
23
|
license = "MIT"
|
|
25
24
|
name = "umt_python"
|
|
26
25
|
readme = "README.md"
|
|
27
|
-
requires-python = ">=3.
|
|
28
|
-
version = "0.
|
|
26
|
+
requires-python = ">=3.10"
|
|
27
|
+
version = "0.3.0"
|
|
29
28
|
|
|
30
29
|
[project.urls]
|
|
31
30
|
"Bug Tracker" = "https://github.com/riya-amemiya/UMT/issues"
|
|
@@ -34,7 +33,38 @@ version = "0.1.1"
|
|
|
34
33
|
|
|
35
34
|
[dependency-groups]
|
|
36
35
|
dev = [
|
|
37
|
-
"pyright==1.1.
|
|
38
|
-
"pytest==
|
|
39
|
-
"
|
|
36
|
+
"pyright==1.1.410",
|
|
37
|
+
"pytest==9.0.3",
|
|
38
|
+
"pytest-cov==7.1.0",
|
|
39
|
+
"ruff==0.15.15",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[tool.ruff.lint]
|
|
43
|
+
select = [
|
|
44
|
+
"ANN",
|
|
45
|
+
"ARG",
|
|
46
|
+
"A",
|
|
47
|
+
"C4",
|
|
48
|
+
"DTZ",
|
|
49
|
+
"E",
|
|
50
|
+
"W",
|
|
51
|
+
"F",
|
|
52
|
+
"FIX",
|
|
53
|
+
"UP",
|
|
54
|
+
"B",
|
|
55
|
+
"SIM",
|
|
56
|
+
"I",
|
|
57
|
+
"RET",
|
|
58
|
+
"PT",
|
|
59
|
+
"N",
|
|
60
|
+
"PERF",
|
|
61
|
+
"PL",
|
|
62
|
+
"FURB",
|
|
63
|
+
"RUF",
|
|
40
64
|
]
|
|
65
|
+
ignore = ["E501", "FBT003", "A005", "PLR2004", "PLR0911","PLR0912","PLR0913"]
|
|
66
|
+
|
|
67
|
+
[tool.ruff.lint.per-file-ignores]
|
|
68
|
+
"tests/**/*.py" = ["ALL"]
|
|
69
|
+
"src/string/to_half_width.py" = ["RUF"]
|
|
70
|
+
"src/string/to_full_width.py" = ["RUF"]
|