Skip to main content

함수의 실행 주기를 객체로 추적하는 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gm_lifecycle-1.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gm_lifecycle-1.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

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

Hashes for gm_lifecycle-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7cb4cfc7982d06e8c1a2a9cb5e41257bdd87cc7168dd5d67261ff39bc55bca07
MD5 8c061bca9c5721ab4473bdc7eea537d7
BLAKE2b-256 59091cc8016fca52500edac0925cdbcbf27e4f7795cdcfb68772cd9fa16d2766

See more details on using hashes here.

Provenance

The following attestation bundles were made for gm_lifecycle-1.1.0.tar.gz:

Publisher: publish.yml on gamultong/gm-lifecycle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for gm_lifecycle-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70dccd4a35f4efee13a0849dc2ddaaf12ed75b7e5edbe071d0e7bf8bdf0bffa7
MD5 967a2a8f909409ad16ac37677e112bb4
BLAKE2b-256 727dcad8cd5bbd7c41b040977edb34e5222ca9131625c5bd3cc082ee96e75131

See more details on using hashes here.

Provenance

The following attestation bundles were made for gm_lifecycle-1.1.0-py3-none-any.whl:

Publisher: publish.yml on gamultong/gm-lifecycle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page