Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Quick application debugging and analysis for Python

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 showme
Octocat-spinner-32 .gitignore
Octocat-spinner-32 AUTHORS
Octocat-spinner-32 HISTORY.rst
Octocat-spinner-32 LISENCE
Octocat-spinner-32 MANIFEST.in
Octocat-spinner-32 NOTICE
Octocat-spinner-32 README.rst
Octocat-spinner-32 ROADMAP.rst
Octocat-spinner-32 fabfile.py
Octocat-spinner-32 reqs.txt
Octocat-spinner-32 setup.py
README.rst

ShowMe -- Quick and easy debugging for Python

ShowMe is a simple set of extremely useful function decorators for Python. It allows you to view trace information, execution time, cputime, and function documentation.

Installation

To use showme, simply:

pip install showme

or, if you must:

easy_install showme

Usage

Print passed-in arguments and function calls.

@showme.trace
def complex_function(a, b, c, **kwargs):
    ...


>>> complex_function('alpha', 'beta', False, debug=True)
calling haystack.submodule.complex_function with
   args: ({'a': 'alpha', 'b': 'beta', 'c': False},)
   kwargs: {'debug': True}

Print function execution time.

@showme.time
def some_function(a):
    ...

>>> some_function()
Execution speed of __main__.some_function:
0.000688076019287 seconds

Print function cpu-execution time.

 @showme.cputime
 def complex_function(a, b, c):
     ...

 >>> complex_function()
 CPU time for __main__.complex_function:
      3 function calls in 0.013 CPU seconds

ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1    0.013    0.013    0.013    0.013 test_time.py:6(test)
     1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
     1    0.000    0.000    0.000    0.000 {range}

Pretty print function documentation.

@showme.docs
def complex_function():
    """Example Documentation for complex_function."""
    ...

>>> complex_function()
Documentation for __main__.complex_function:
Example Documentation for complex_function.
Something went wrong with that request. Please try again.