sys-num 0.0.1__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.
@@ -0,0 +1,4 @@
1
+ MIT LICENSE:
2
+
3
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4
+
sys_num-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: sys_num
3
+ Version: 0.0.1
4
+ Summary: A clean utility module for math rounding, currency formatting, and PB tracking.
5
+ Author-email: Your Name <sevugganpythoncoder@gmail.com>
6
+ License: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.7
10
+ Description-Content-Type: text/markdown
11
+ License-File: License.txt
12
+ Dynamic: license-file
File without changes
File without changes
@@ -0,0 +1,37 @@
1
+ """
2
+ num_utils.py - A custom utility module for clean math operations,
3
+ rounding fixes, and percentage metrics.
4
+ """
5
+
6
+ def clean_round(value: float, decimals: int = 2) -> float:
7
+ """
8
+ Solves floating-point accuracy bugs by rounding safely.
9
+ Example: clean_round(2.675, 2) -> 2.68
10
+ """
11
+ # Adding a tiny epsilon prevents Python's binary floating-point rounding flaws
12
+ epsilon = 1e-9
13
+ if value >= 0:
14
+ return round(value + epsilon, decimals)
15
+ return round(value - epsilon, decimals)
16
+
17
+
18
+ def format_currency(amount: float, symbol: str = "₹") -> str:
19
+ """
20
+ Formats a raw float cleanly into a currency layout.
21
+ Example: format_currency(1250.5) -> "₹1,250.50"
22
+ """
23
+ rounded_amount = clean_round(amount, 2)
24
+ return f"{symbol}{rounded_amount:,.2f}"
25
+
26
+
27
+ def calculate_pb_increase(old_best: float, new_best: float) -> float:
28
+ """
29
+ Calculates the exact percentage improvement between two records.
30
+ Example: Going from 20 push-ups to 26.
31
+ """
32
+ if old_best == 0:
33
+ return 100.0 if new_best > 0 else 0.0
34
+
35
+ increase = new_best - old_best
36
+ percentage = (increase / old_best) * 100
37
+ return clean_round(percentage, 1)
@@ -0,0 +1,21 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "sys_num"
7
+ version = "0.0.1"
8
+ authors = [
9
+ { name="Your Name", email="sevugganpythoncoder@gmail.com" },
10
+ ]
11
+ description = "A clean utility module for math rounding, currency formatting, and PB tracking."
12
+ readme = "README.md"
13
+ requires-python = ">=3.7"
14
+ license = { text = "MIT" } # This fixes the license warning!
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "Operating System :: OS Independent",
18
+ ]
19
+
20
+ [tool.setuptools]
21
+ packages = ["num_utils"] # This explicitly tells Python where your package folder is!
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: sys_num
3
+ Version: 0.0.1
4
+ Summary: A clean utility module for math rounding, currency formatting, and PB tracking.
5
+ Author-email: Your Name <sevugganpythoncoder@gmail.com>
6
+ License: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.7
10
+ Description-Content-Type: text/markdown
11
+ License-File: License.txt
12
+ Dynamic: license-file
@@ -0,0 +1,9 @@
1
+ License.txt
2
+ README.md
3
+ pyproject.toml
4
+ num_utils/__init__.py
5
+ num_utils/num_utils.py
6
+ sys_num.egg-info/PKG-INFO
7
+ sys_num.egg-info/SOURCES.txt
8
+ sys_num.egg-info/dependency_links.txt
9
+ sys_num.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ num_utils