함수의 실행 주기를 객체로 추적하는 Python 라이브러리
Project description
gm-lifecycle
함수의 실행 주기를 객체로 추적하는 Python 라이브러리입니다.
설치
pip install gm-lifecycle
소개
gm-lifecycle은 함수 호출 한 번을 하나의 LifeCycle 객체로 표현합니다. 함수 실행 중 원하는 데이터를 기록하고, 함수 간 호출 관계를 자동으로 추적하며, 실행 완료나 예외 발생 시 hook을 실행할 수 있습니다.
빠른 시작
from lifecycle import App, TracerManager, LifeCycle
class MyLC(LifeCycle[[int, int], int]):
def on_enter(self, a: int, b: int) -> None:
self.operands = (a, b)
def on_exit(self, return_value: int) -> None:
print(f"{self.operands[0]} + {self.operands[1]} = {return_value}")
app = App()
manager = TracerManager(MyLC, app)
@manager.tracing
def add(a: int, b: int) -> int:
return a + b
add(1, 2) # 1 + 2 = 3
문서
모듈 상세 API는 lifecycle/README.md를 참고하세요.
라이선스
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gm_lifecycle-1.1.0.tar.gz.
File metadata
- Download URL: gm_lifecycle-1.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cb4cfc7982d06e8c1a2a9cb5e41257bdd87cc7168dd5d67261ff39bc55bca07
|
|
| MD5 |
8c061bca9c5721ab4473bdc7eea537d7
|
|
| BLAKE2b-256 |
59091cc8016fca52500edac0925cdbcbf27e4f7795cdcfb68772cd9fa16d2766
|
Provenance
The following attestation bundles were made for gm_lifecycle-1.1.0.tar.gz:
Publisher:
publish.yml on gamultong/gm-lifecycle
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gm_lifecycle-1.1.0.tar.gz -
Subject digest:
7cb4cfc7982d06e8c1a2a9cb5e41257bdd87cc7168dd5d67261ff39bc55bca07 - Sigstore transparency entry: 1251959053
- Sigstore integration time:
-
Permalink:
gamultong/gm-lifecycle@dfe00b380b0e87efc6b792351b045aff8d2b4d4e -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/gamultong
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dfe00b380b0e87efc6b792351b045aff8d2b4d4e -
Trigger Event:
push
-
Statement type:
File details
Details for the file gm_lifecycle-1.1.0-py3-none-any.whl.
File metadata
- Download URL: gm_lifecycle-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70dccd4a35f4efee13a0849dc2ddaaf12ed75b7e5edbe071d0e7bf8bdf0bffa7
|
|
| MD5 |
967a2a8f909409ad16ac37677e112bb4
|
|
| BLAKE2b-256 |
727dcad8cd5bbd7c41b040977edb34e5222ca9131625c5bd3cc082ee96e75131
|
Provenance
The following attestation bundles were made for gm_lifecycle-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on gamultong/gm-lifecycle
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gm_lifecycle-1.1.0-py3-none-any.whl -
Subject digest:
70dccd4a35f4efee13a0849dc2ddaaf12ed75b7e5edbe071d0e7bf8bdf0bffa7 - Sigstore transparency entry: 1251959160
- Sigstore integration time:
-
Permalink:
gamultong/gm-lifecycle@dfe00b380b0e87efc6b792351b045aff8d2b4d4e -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/gamultong
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dfe00b380b0e87efc6b792351b045aff8d2b4d4e -
Trigger Event:
push
-
Statement type: