Skip to main content

godlights

GL: All In One (aio) — 여러 변수에 같은 attribute / 같은 함수를 한 번에 적용.

설치

pip install .          # 프로젝트 폴더에서
pip install -e .       # 개발용(편집 즉시 반영)

사용

from godlights import allinone as aio   # 또는: from godlights import aio

class P:
    def __init__(self, hp): self.hp = hp
    def heal(self, amount):
        self.hp += amount
        return self.hp

a, b, c = P(10), P(20), P(30)

aio.call_all(a, b, c, argument="hp")    # [10, 20, 30]
aio.call_all(a, b, c, "hp")             # [10, 20, 30]

aio.set_all(a, b, c, argument="hp", value=100)   # a.hp = b.hp = c.hp = 100, [100, 100, 100] 반환

x1, x2, x3 = aio.run_func(str.upper, "a", "b", "c")   # 'A', 'B', 'C'
d1, d2 = aio.run_func(lambda x, n: x**n, 2, 3, n=2)   # 4, 9

aio.call_method(a, b, c, method="heal", amount=10)   # [110, 110, 110]

aio.flatten_call([a, b, c], argument="hp")   # [110, 110, 110]

# 결과를 바로 출력하고 싶으면 뒤에 .print()를 붙이면 됨 (출력 후 같은 값을 그대로 반환)
aio.call_all(a, b, c, argument="hp").print()   # 콘솔에 [110, 110, 110] 출력

함수

  • call_all(*args, argument) — 각 변수의 argument attribute를 리스트로 반환.
  • set_all(*args, argument, value) — 각 변수의 argument attribute에 동일한 value를 한 번에 설정하고, 설정된 값들을 리스트로 반환.
  • run_func(function, *args, **kwargs)function(arg)를 각 arg마다 실행해 리스트로 반환. kwargs는 공통 전달.
  • call_method(*args, method, **kwargs) — 각 변수의 같은 메서드를 동일 kwargs로 호출해 결과를 리스트로 반환.
  • flatten_call(iterable, argument) — list/tuple 등에 든 변수들의 같은 attribute를 리스트로 반환.

모든 *args 헬퍼(call_all, set_all, call_method)는 argument/method를 키워드로 넘기거나, 마지막 위치 인자로 넘길 수 있습니다.

.print()로 바로 출력하기

위 5개 함수(call_all, set_all, run_func, call_method, flatten_call)는 모두 일반 list처럼 동작하는 AioList를 반환합니다. 결과 뒤에 .print()를 붙이면 즉시 콘솔에 출력되고, 같은 값이 그대로 반환되어 계속 체이닝하거나 변수에 담을 수 있습니다.

from godlights import AioList

result = aio.call_all(a, b, c, argument="hp").print()   # [110, 110, 110] 출력
assert isinstance(result, AioList)
assert result == [110, 110, 110]

빌드 / 배포

pip install build twine
python -m build            # dist/ 에 sdist, wheel 생성
twine upload dist/*        # PyPI 업로드

테스트

pip install pytest
pip install -e .
pytest

CI/CD

  • .github/workflows/test.yml — push/PR마다 Python 3.8~3.12에서 pytest 실행
  • .github/workflows/publish.yml — GitHub Release를 publish하면 빌드 후 PyPI에 업로드 (Trusted Publishing/OIDC 사용, PyPI 프로젝트 설정에서 이 저장소를 trusted publisher로 먼저 등록해야 함)

Release files for godlights 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for godlights 0.1.2
File Size Uploaded
godlights-0.1.2.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for godlights 0.1.2
File Interpreter ABI Platform
godlights-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / godlights-0.1.2.tar.gz

Download URL godlights-0.1.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6177408f18000806fadb6df0280696e22453cc5b1ecb145880f632aea7089f50
BLAKE2b-256 checksum
How to use checksums
0b2177c4a16d0a03c5bd8441311863f35d48694ed2cc09eb72b1c7f4c62df546
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release files / godlights-0.1.2-py3-none-any.whl

Download URL godlights-0.1.2-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
762621f47b6b9e58d81fc422a6eb62e48c33a8a0938ee145ba0fc9defbfdb4d9
BLAKE2b-256 checksum
How to use checksums
97580b2e5bc4c189d0c38447b1417341296581434ded0638450a11d85720c659
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.6

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page