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.0.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.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_decorators_utils-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 e11f72017a80e1e67f3b3d436115ec4c21b3a0e8f44d59bd51810c71ae7895d9
MD5 7f938f55ee09a01fdcedb5cf51a23a0f
BLAKE2b-256 5864e64cc0edef3c490720c6fe8ae22472a4fe0323f66d20c52f483d5429d886

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_decorators_utils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b1d909d841ebc1bf98fc0d7fed26ee46325ba94dafe1b6476d99ff44b662f6f
MD5 d62fecf76a0ea6ee9e653adc15fdbc26
BLAKE2b-256 1139a42f7da9cf9d8516e172a1f1aa7e2993c3e3bf51ee577f949bdab157dcae

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