Skip to main content

Simple python decorators for measuring function execution times.

Project description

cutime

Simple python decorators for measuring function execution times.


Installation

pip install cutime

Usage

from cutime import gettime, avgtime, sumtime

@gettime
def hello():
    print("Hello World!")

hello()

Build & Install Locally

In the same directory as setup.py, run:

pip install build
python -m build

Publishing

Step 1 - Install needed Tools

pip install hatch twine

Step 2 - Build

hatch build

Step 3 - Test with TestPyPI

python -m twine upload --repository testpypi dist/*

Step 4 - Test the Test

pip install -i https://test.pypi.org/simple/ cutime

Step 5 - Real Upload

python -m twine upload dist/*

Expansions

New Decorators

Category Ideas
Better output control Add options for logging results to file, CSV, or JSON.
Context manager support Add with syntax to measure arbitrary code blocks.
Pretty printing Use tabulate or rich for formatted terminal output.
Statistical summaries Track mean, median, std deviation across runs.
Async support Add timing decorators for async def functions.
Profiling integration Integrate with Python’s cProfile or timeit.
Custom reporting hooks Allow users to supply callbacks for each timing.

Better Packaging

Area Expansion
CLI tool Add a command-line utility: python -m cutime script.py
Docs site Add documentation via MkDocs or Sphinx
Tests Add pytest-based test suite
Badges Add shields.io badges (version, license, PyPI)

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

cutime-1.0.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.

cutime-1.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file cutime-1.0.0.tar.gz.

File metadata

  • Download URL: cutime-1.0.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for cutime-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8cba68df9dd4fe37ca32c32b573aa09a2d98d33323914710e2cffddf4ee6b119
MD5 559c04a959cb21043bec8fb0b8c827cd
BLAKE2b-256 b6bb0bc46e48dab8fadf4f11abe3c28c1beb1c8df1fbfd3f1f2fe6d48f85c37c

See more details on using hashes here.

File details

Details for the file cutime-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cutime-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for cutime-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6ff6d301bfda929377410da716379c9f5390fb840c6f064fb66f0239ee48983
MD5 961ffaa446b4fc656e6fe2175afb3a7a
BLAKE2b-256 c9fe09bb6eb3b3d24f1db75d92f351553b194ed82035c52eead1da11f5d4b378

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