mypkg-b961221-cli 0.1.4__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.
- mypkg_b961221_cli-0.1.4/PKG-INFO +16 -0
- mypkg_b961221_cli-0.1.4/README.md +8 -0
- mypkg_b961221_cli-0.1.4/mypkg/__init__.py +2 -0
- mypkg_b961221_cli-0.1.4/mypkg/__main__.py +63 -0
- mypkg_b961221_cli-0.1.4/mypkg/core.py +5 -0
- mypkg_b961221_cli-0.1.4/mypkg/helpers.py +16 -0
- mypkg_b961221_cli-0.1.4/mypkg_b961221_cli.egg-info/PKG-INFO +16 -0
- mypkg_b961221_cli-0.1.4/mypkg_b961221_cli.egg-info/SOURCES.txt +11 -0
- mypkg_b961221_cli-0.1.4/mypkg_b961221_cli.egg-info/dependency_links.txt +1 -0
- mypkg_b961221_cli-0.1.4/mypkg_b961221_cli.egg-info/entry_points.txt +2 -0
- mypkg_b961221_cli-0.1.4/mypkg_b961221_cli.egg-info/top_level.txt +2 -0
- mypkg_b961221_cli-0.1.4/pyproject.toml +20 -0
- mypkg_b961221_cli-0.1.4/setup.cfg +4 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mypkg-b961221-cli
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: A simple statistics package
|
|
5
|
+
Author-email: JaeSeok Kim <bike961221@gmail.com>
|
|
6
|
+
Requires-Python: >=3.8
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# mypkg
|
|
10
|
+
|
|
11
|
+
A simple Python statistics package.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install mypkg-b961221
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
|
|
2
|
+
mport argparse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def main():
|
|
6
|
+
parser = argparse.ArgumentParser(
|
|
7
|
+
prog="mypkg",
|
|
8
|
+
description="내가 만든 CLI 프로그램 😎"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
subparsers = parser.add_subparsers(dest="command")
|
|
12
|
+
|
|
13
|
+
# add 명령
|
|
14
|
+
add_parser = subparsers.add_parser("add", help="숫자 덧셈")
|
|
15
|
+
add_parser.add_argument("numbers", nargs="+", type=int)
|
|
16
|
+
|
|
17
|
+
# mul 명령
|
|
18
|
+
mul_parser = subparsers.add_parser("mul", help="숫자 곱셈")
|
|
19
|
+
mul_parser.add_argument("numbers", nargs="+", type=int)
|
|
20
|
+
|
|
21
|
+
args = parser.parse_args()
|
|
22
|
+
|
|
23
|
+
if args.command == "add":
|
|
24
|
+
print("덧셈 결과 =", sum(args.numbers))
|
|
25
|
+
|
|
26
|
+
elif args.command == "mul":
|
|
27
|
+
result = 1
|
|
28
|
+
for n in args.numbers:
|
|
29
|
+
result *= n
|
|
30
|
+
print("곱셈 결과 =", result)
|
|
31
|
+
|
|
32
|
+
else:
|
|
33
|
+
parser.print_help()
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
version_parser = subparsers.add_parser("version", help="버전 출력")
|
|
37
|
+
|
|
38
|
+
if __name__ == "__main__":
|
|
39
|
+
main()
|
|
40
|
+
|
|
41
|
+
if args.command == "stats":
|
|
42
|
+
numbers = [float(x) for x in args.numbers]
|
|
43
|
+
print(sum(numbers)/len(numbers))
|
|
44
|
+
|
|
45
|
+
elif args.command == "version":
|
|
46
|
+
print("mypkg version 0.1.2 😎")
|
|
47
|
+
|
|
48
|
+
stats_parser = subparsers.add_parser("stats", help="통계 계산")
|
|
49
|
+
stats_parser.add_argument("numbers", nargs="+", type=int)
|
|
50
|
+
|
|
51
|
+
elif args.command == "stats":
|
|
52
|
+
nums = args.numbers
|
|
53
|
+
print("개수 =", len(nums))
|
|
54
|
+
print("합계 =", sum(nums))
|
|
55
|
+
print("평균 =", sum(nums) / len(nums))
|
|
56
|
+
|
|
57
|
+
config_parser = subparsers.add_parser("config", help="설정 보기")
|
|
58
|
+
|
|
59
|
+
elif args.command == "config":
|
|
60
|
+
print("설정 없음 😆 (나중에 추가 가능)")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
def calculate_stats(data):
|
|
2
|
+
return {
|
|
3
|
+
"mean": sum(data) / len(data),
|
|
4
|
+
"min": min(data),
|
|
5
|
+
"max": max(data),
|
|
6
|
+
}
|
|
7
|
+
def add(a, b):
|
|
8
|
+
return a + b
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def calculate_stats(data):
|
|
12
|
+
return {
|
|
13
|
+
"mean": sum(data) / len(data),
|
|
14
|
+
"min": min(data),
|
|
15
|
+
"max": max(data),
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mypkg-b961221-cli
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: A simple statistics package
|
|
5
|
+
Author-email: JaeSeok Kim <bike961221@gmail.com>
|
|
6
|
+
Requires-Python: >=3.8
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# mypkg
|
|
10
|
+
|
|
11
|
+
A simple Python statistics package.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install mypkg-b961221
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
mypkg/__init__.py
|
|
4
|
+
mypkg/__main__.py
|
|
5
|
+
mypkg/core.py
|
|
6
|
+
mypkg/helpers.py
|
|
7
|
+
mypkg_b961221_cli.egg-info/PKG-INFO
|
|
8
|
+
mypkg_b961221_cli.egg-info/SOURCES.txt
|
|
9
|
+
mypkg_b961221_cli.egg-info/dependency_links.txt
|
|
10
|
+
mypkg_b961221_cli.egg-info/entry_points.txt
|
|
11
|
+
mypkg_b961221_cli.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mypkg-b961221-cli"
|
|
7
|
+
version = "0.1.4"
|
|
8
|
+
description = "A simple statistics package"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name="JaeSeok Kim", email="bike961221@gmail.com" }
|
|
11
|
+
]
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.8"
|
|
14
|
+
dependencies = []
|
|
15
|
+
|
|
16
|
+
[tool.setuptools.packages.find]
|
|
17
|
+
where = ["."]
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
mypkg = "mypkg.__main__:main"
|