Skip to main content

A collection of useful Python decorators including timing and caching

Project description

Python Decorators Utils

A collection of useful Python decorators including:

  • Timing decorator: Measures function execution time
  • Cache decorator: Implements function result caching

Installation

pip install python-decorators-utils

Usage

from python_decorators_utils import timing_decorator, cache_decorator

@timing_decorator
def slow_function():
    time.sleep(1)
    return "done"

@cache_decorator
def fibonacci(n):
    if n < 2: return n
    return fibonacci(n-1) + fibonacci(n-2)

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

python_decorators_utils-0.1.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

python_decorators_utils-0.1.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file python_decorators_utils-0.1.2.tar.gz.

File metadata

  • Download URL: python_decorators_utils-0.1.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for python_decorators_utils-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8216ef3e215aab7187e3b9d07a2c169cbb27f83f0ee07372b6ab07f9a42a4976
MD5 aa6caf82ae382bbee25658722dad5522
BLAKE2b-256 d0006ee66a3e58642c6f383b5b446a130385e3d3ffb7715fdc9267789953169d

See more details on using hashes here.

File details

Details for the file python_decorators_utils-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_decorators_utils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 638590c20d40edc2c43580f5bc6d04ca9cc35d93d88d5e192ce7cefe749b340b
MD5 9e210dc5df3496743bd23cea97cbc97f
BLAKE2b-256 36a003122da68fdb3c09d15b50f13be5ba59bab5c0497e68485a43b449f11c4d

See more details on using hashes here.

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