quickmath-tools 0.1.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.
@@ -0,0 +1,29 @@
1
+ Metadata-Version: 2.4
2
+ Name: quickmath-tools
3
+ Version: 0.1.0
4
+ Summary: A small collection of basic arithmetic operations.
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
7
+
8
+ # quickmath-tools
9
+
10
+ A small Python package with basic arithmetic helpers.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pip install quickmath-tools
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```python
21
+ from quickmath_tools import add, divide, multiply, subtract
22
+
23
+ print(add(2, 3)) # 5
24
+ print(subtract(5, 2)) # 3
25
+ print(multiply(4, 3)) # 12
26
+ print(divide(9, 3)) # 3.0
27
+ ```
28
+
29
+ `divide(a, b)` raises `ZeroDivisionError` when `b` is zero.
@@ -0,0 +1,22 @@
1
+ # quickmath-tools
2
+
3
+ A small Python package with basic arithmetic helpers.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install quickmath-tools
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```python
14
+ from quickmath_tools import add, divide, multiply, subtract
15
+
16
+ print(add(2, 3)) # 5
17
+ print(subtract(5, 2)) # 3
18
+ print(multiply(4, 3)) # 12
19
+ print(divide(9, 3)) # 3.0
20
+ ```
21
+
22
+ `divide(a, b)` raises `ZeroDivisionError` when `b` is zero.
@@ -0,0 +1,13 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "quickmath-tools"
7
+ version = "0.1.0"
8
+ description = "A small collection of basic arithmetic operations."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+
12
+ [tool.setuptools.packages.find]
13
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,32 @@
1
+ """Basic arithmetic helpers."""
2
+
3
+ from typing import Union
4
+
5
+ Number = Union[int, float]
6
+
7
+
8
+ def add(a: Number, b: Number) -> Number:
9
+ """Return the sum of two numbers."""
10
+ return a + b
11
+
12
+
13
+ def subtract(a: Number, b: Number) -> Number:
14
+ """Return the difference of two numbers."""
15
+ return a - b
16
+
17
+
18
+ def multiply(a: Number, b: Number) -> Number:
19
+ """Return the product of two numbers."""
20
+ return a * b
21
+
22
+
23
+ def divide(a: Number, b: Number) -> float:
24
+ """Return a divided by b.
25
+
26
+ Raises:
27
+ ZeroDivisionError: If b is zero.
28
+ """
29
+ return a / b
30
+
31
+
32
+ __all__ = ["Number", "add", "subtract", "multiply", "divide"]
@@ -0,0 +1,29 @@
1
+ Metadata-Version: 2.4
2
+ Name: quickmath-tools
3
+ Version: 0.1.0
4
+ Summary: A small collection of basic arithmetic operations.
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
7
+
8
+ # quickmath-tools
9
+
10
+ A small Python package with basic arithmetic helpers.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pip install quickmath-tools
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```python
21
+ from quickmath_tools import add, divide, multiply, subtract
22
+
23
+ print(add(2, 3)) # 5
24
+ print(subtract(5, 2)) # 3
25
+ print(multiply(4, 3)) # 12
26
+ print(divide(9, 3)) # 3.0
27
+ ```
28
+
29
+ `divide(a, b)` raises `ZeroDivisionError` when `b` is zero.
@@ -0,0 +1,8 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/quickmath_tools/__init__.py
4
+ src/quickmath_tools.egg-info/PKG-INFO
5
+ src/quickmath_tools.egg-info/SOURCES.txt
6
+ src/quickmath_tools.egg-info/dependency_links.txt
7
+ src/quickmath_tools.egg-info/top_level.txt
8
+ tests/test_operations.py
@@ -0,0 +1 @@
1
+ quickmath_tools
@@ -0,0 +1,26 @@
1
+ import unittest
2
+
3
+ from quickmath_tools import add, divide, multiply, subtract
4
+
5
+
6
+ class TestOperations(unittest.TestCase):
7
+ def test_add(self):
8
+ self.assertEqual(add(2, 3), 5)
9
+ self.assertEqual(add(2.5, 3), 5.5)
10
+
11
+ def test_subtract(self):
12
+ self.assertEqual(subtract(5, 3), 2)
13
+
14
+ def test_multiply(self):
15
+ self.assertEqual(multiply(4, 3), 12)
16
+
17
+ def test_divide(self):
18
+ self.assertEqual(divide(9, 3), 3)
19
+
20
+ def test_divide_by_zero(self):
21
+ with self.assertRaises(ZeroDivisionError):
22
+ divide(1, 0)
23
+
24
+
25
+ if __name__ == "__main__":
26
+ unittest.main()