godlights 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,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,47 @@
1
+ # godlights
2
+
3
+ GL: All In One (`aio`) — 여러 변수에 같은 attribute / 같은 함수를 한 번에 적용.
4
+
5
+ ## 설치
6
+
7
+ ```bash
8
+ pip install . # 프로젝트 폴더에서
9
+ pip install -e . # 개발용(편집 즉시 반영)
10
+ ```
11
+
12
+ ## 사용
13
+
14
+ ```python
15
+ from godlights import allinone as aio # 또는: from godlights import aio
16
+
17
+ class P:
18
+ def __init__(self, hp): self.hp = hp
19
+
20
+ a, b, c = P(10), P(20), P(30)
21
+
22
+ aio.call_all(a, b, c, argument="hp") # [10, 20, 30]
23
+ aio.call_all(a, b, c, "hp") # [10, 20, 30]
24
+
25
+ x1, x2, x3 = aio.run_func(str.upper, "a", "b", "c") # 'A', 'B', 'C'
26
+ d1, d2 = aio.run_func(lambda x, n: x**n, 2, 3, n=2) # 4, 9
27
+ ```
28
+
29
+ ## 함수
30
+
31
+ - `call_all(*args, argument)` — 각 변수의 `argument` attribute를 리스트로 반환.
32
+ - `run_func(function, *args, **kwargs)` — `function(arg)`를 각 arg마다 실행해 리스트로 반환. `kwargs`는 공통 전달.
33
+
34
+ ## 빌드 / 배포
35
+
36
+ ```bash
37
+ pip install build twine
38
+ python -m build # dist/ 에 sdist, wheel 생성
39
+ twine upload dist/* # PyPI 업로드
40
+ ```
41
+
42
+ ## 테스트
43
+
44
+ ```bash
45
+ pip install pytest
46
+ pytest
47
+ ```
@@ -0,0 +1,15 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "godlights"
7
+ version = "0.1.0"
8
+ description = "GL: All In One (aio) - 여러 변수에 같은 attribute/함수를 한 번에 적용하는 유틸"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+ dependencies = []
13
+
14
+ [tool.setuptools.packages.find]
15
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,6 @@
1
+ from .core import allinone
2
+
3
+ aio = allinone # 약칭
4
+
5
+ __all__ = ["allinone", "aio"]
6
+ __version__ = "0.1.0"
@@ -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,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/godlights/__init__.py
4
+ src/godlights/core.py
5
+ src/godlights.egg-info/PKG-INFO
6
+ src/godlights.egg-info/SOURCES.txt
7
+ src/godlights.egg-info/dependency_links.txt
8
+ src/godlights.egg-info/top_level.txt
9
+ tests/test_allinone.py
@@ -0,0 +1 @@
1
+ godlights
@@ -0,0 +1,47 @@
1
+ import pytest
2
+
3
+ import godlights
4
+ from godlights import allinone as aio
5
+
6
+
7
+ class P:
8
+ def __init__(self, hp):
9
+ self.hp = hp
10
+
11
+
12
+ def test_call_all_keyword():
13
+ a, b, c = P(10), P(20), P(30)
14
+ assert aio.call_all(a, b, c, argument="hp") == [10, 20, 30]
15
+
16
+
17
+ def test_call_all_positional():
18
+ a, b = P(1), P(2)
19
+ assert aio.call_all(a, b, "hp") == [1, 2]
20
+
21
+
22
+ def test_call_all_missing_attr():
23
+ with pytest.raises(AttributeError):
24
+ aio.call_all(P(1), argument="mp")
25
+
26
+
27
+ def test_call_all_too_few():
28
+ with pytest.raises(TypeError):
29
+ aio.call_all("hp")
30
+
31
+
32
+ def test_run_func_unpack():
33
+ a1, a2, a3 = aio.run_func(str.upper, "a", "b", "c")
34
+ assert (a1, a2, a3) == ("A", "B", "C")
35
+
36
+
37
+ def test_run_func_kwargs():
38
+ d1, d2 = aio.run_func(lambda x, n: x ** n, 2, 3, n=2)
39
+ assert (d1, d2) == (4, 9)
40
+
41
+
42
+ def test_run_func_returns_list():
43
+ assert isinstance(aio.run_func(abs, -1, -2), list)
44
+
45
+
46
+ def test_module_access():
47
+ assert godlights.allinone is godlights.aio