godlights 0.1.0__py3-none-any.whl

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.
godlights/__init__.py ADDED
@@ -0,0 +1,6 @@
1
+ from .core import allinone
2
+
3
+ aio = allinone # 약칭
4
+
5
+ __all__ = ["allinone", "aio"]
6
+ __version__ = "0.1.0"
godlights/core.py ADDED
@@ -0,0 +1,25 @@
1
+ class allinone: # GL: All In One (aio)
2
+ """여러 변수에 같은 작업을 한 번에 적용하는 유틸 모음."""
3
+
4
+ @staticmethod
5
+ def call_all(*args, argument=None):
6
+ """여러 변수의 같은 attribute(argument)를 리스트로 반환.
7
+
8
+ aio.call_all(a, b, c, argument="hp") -> [a.hp, b.hp, c.hp]
9
+ aio.call_all(a, b, c, "hp") -> 동일 (마지막 인자를 argument로 처리)
10
+ """
11
+ if argument is None:
12
+ if len(args) < 2:
13
+ raise TypeError("변수 1개 이상과 argument가 필요함")
14
+ *args, argument = args
15
+ return [getattr(v, argument) for v in args]
16
+
17
+ @staticmethod
18
+ def run_func(function, *args, **kwargs):
19
+ """같은 함수에 args를 하나씩 넣어 결과를 리스트로 반환.
20
+
21
+ a1, a2, a3 = aio.run_func(f, x1, x2, x3)
22
+ -> a1 = f(x1), a2 = f(x2), a3 = f(x3)
23
+ kwargs는 매 호출에 공통으로 전달됨.
24
+ """
25
+ return [function(v, **kwargs) for v in args]
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.4
2
+ Name: godlights
3
+ Version: 0.1.0
4
+ Summary: GL: All In One (aio) - 여러 변수에 같은 attribute/함수를 한 번에 적용하는 유틸
5
+ License: MIT
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+
9
+ # godlights
10
+
11
+ GL: All In One (`aio`) — 여러 변수에 같은 attribute / 같은 함수를 한 번에 적용.
12
+
13
+ ## 설치
14
+
15
+ ```bash
16
+ pip install . # 프로젝트 폴더에서
17
+ pip install -e . # 개발용(편집 즉시 반영)
18
+ ```
19
+
20
+ ## 사용
21
+
22
+ ```python
23
+ from godlights import allinone as aio # 또는: from godlights import aio
24
+
25
+ class P:
26
+ def __init__(self, hp): self.hp = hp
27
+
28
+ a, b, c = P(10), P(20), P(30)
29
+
30
+ aio.call_all(a, b, c, argument="hp") # [10, 20, 30]
31
+ aio.call_all(a, b, c, "hp") # [10, 20, 30]
32
+
33
+ x1, x2, x3 = aio.run_func(str.upper, "a", "b", "c") # 'A', 'B', 'C'
34
+ d1, d2 = aio.run_func(lambda x, n: x**n, 2, 3, n=2) # 4, 9
35
+ ```
36
+
37
+ ## 함수
38
+
39
+ - `call_all(*args, argument)` — 각 변수의 `argument` attribute를 리스트로 반환.
40
+ - `run_func(function, *args, **kwargs)` — `function(arg)`를 각 arg마다 실행해 리스트로 반환. `kwargs`는 공통 전달.
41
+
42
+ ## 빌드 / 배포
43
+
44
+ ```bash
45
+ pip install build twine
46
+ python -m build # dist/ 에 sdist, wheel 생성
47
+ twine upload dist/* # PyPI 업로드
48
+ ```
49
+
50
+ ## 테스트
51
+
52
+ ```bash
53
+ pip install pytest
54
+ pytest
55
+ ```
@@ -0,0 +1,6 @@
1
+ godlights/__init__.py,sha256=zWw4XAWB78qHFW3EJUmoJdEAG0pt1qsPhQHuuY3Qchg,110
2
+ godlights/core.py,sha256=BBvxZzTuVSt28bh1TUX5jg8_KziYLPeAvUYWKKmgjlM,1054
3
+ godlights-0.1.0.dist-info/METADATA,sha256=ASU3w2dn__utz0v_Dz3wgTPnvuCzHik6-oXCNO5YJxU,1416
4
+ godlights-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
5
+ godlights-0.1.0.dist-info/top_level.txt,sha256=TtI0JVT33y77XpLm8RRylcBtGPulmm6nELpiD8QYwJw,10
6
+ godlights-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ godlights