vikash-python-library 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.
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "vikash-python-library"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Add your description here"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Vikash kumar", email = "23f2000729@ds.study.iitm.ac.in" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
dependencies = []
|
|
11
|
+
|
|
12
|
+
[project.scripts]
|
|
13
|
+
python-library = "python_library:main"
|
|
14
|
+
|
|
15
|
+
[build-system]
|
|
16
|
+
requires = ["uv_build>=0.11.18,<0.12.0"]
|
|
17
|
+
build-backend = "uv_build"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
def add(numbers):
|
|
4
|
+
return sum(numbers)
|
|
5
|
+
|
|
6
|
+
def multiply(numbers):
|
|
7
|
+
result = 1
|
|
8
|
+
for num in numbers:
|
|
9
|
+
result *= num
|
|
10
|
+
return result
|
|
11
|
+
|
|
12
|
+
def main():
|
|
13
|
+
parser = argparse.ArgumentParser()
|
|
14
|
+
|
|
15
|
+
parser.add_argument(
|
|
16
|
+
"operation",
|
|
17
|
+
choices=["add", "multiply"]
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
parser.add_argument(
|
|
21
|
+
"numbers",
|
|
22
|
+
nargs="+",
|
|
23
|
+
type=float
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
my_arg = parser.parse_args()
|
|
27
|
+
|
|
28
|
+
if my_arg.operation == "add":
|
|
29
|
+
result = add(my_arg.numbers)
|
|
30
|
+
|
|
31
|
+
elif my_arg.operation == "multiply":
|
|
32
|
+
result = multiply(my_arg.numbers)
|
|
33
|
+
|
|
34
|
+
return result
|
|
35
|
+
|