• Stars
    star
    188
  • Rank 201,423 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 14 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Quick application debugging and analysis for Python

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.

More Repositories

1

setup.py

πŸ“¦ A Human's Ultimate Guide to setup.py.
Python
5,064
star
2

samplemod

Python
4,745
star
3

flask-googlefed

Google Federated Logins for Flask.
Python
75
star
4

exp-smoothing-java

Exponential Smoothing & Moving Average Models in Java
Java
24
star
5

customer-churn

Customer churn analysis using Telco dataset
Jupyter Notebook
23
star
6

interpretable-ml

Techniques & resources for training interpretable ML models, explaining ML models, and debugging ML models.
Jupyter Notebook
19
star
7

eng_join

An english joiner for Python.
Python
14
star
8

py-programming

Overview of Programming in Python
Python
9
star
9

robust-random-cut-forest

Implementation of the Robust Random Cut Forest algorithm for anomaly detection
Python
7
star
10

kaggle

Kaggle code
Jupyter Notebook
7
star
11

sdss-2019

Interpretable Machine Learning with rsparkling
R
6
star
12

h2o-r-examples

H2O-3 Examples in R
HTML
6
star
13

r-programming

Overview of R Programming
R
6
star
14

sparkling-water-emr

Launch Sparkling Water on EMR
5
star
15

stats-and-ml

The wonderful world of Statistics & Machine Learning
MATLAB
4
star
16

radix-sort-string

Sorts C-strings array's in alphabetical order
C
4
star
17

sdss-h2o-automl

Code & presentation for the 'H2O AutoML' short course at SDSS 2018 in Reston, VA
HTML
3
star
18

snippets

Code snippets/workflows that I use day-to-day
Shell
3
star
19

jsm-2018

Joint Statistical Meeting 2018
R
3
star
20

wasm-cat

C++ WASM demo
C++
2
star
21

EDAStudio

A Shiny Application for Exploring Data
R
2
star
22

code-cracking

Fun with Algos
Java
2
star
23

dimreduce4gpu

Dimensionality reduction ("dimreduce") on GPUs ("4gpu")
Cuda
2
star
24

accuweather

A Java API for AccuWeather
Java
2
star
25

model-gov

Model governance in h2o-3
R
2
star
26

buildGradleProject

Python script to build Gradle project
Python
1
star
27

h2o3-pam

Implementation of Partitioning Around Medoids (PAM) in H2O-3
Java
1
star
28

h2o3-gapstat

Estimating the number of clusters in a data set via the gap statistic. Implemented in H2O-3
Java
1
star
29

go-programming

Golang
Go
1
star
30

quake

a Java API for querying earthquake data
Java
1
star
31

machine-learning

Work I did for Andrew Ng's ML course.
MATLAB
1
star
32

h2o-ec2

Launch an H2O cluster in EC2 Classic
Shell
1
star
33

java-programming

Programming in Java
Java
1
star
34

fair-ml

Fairness in AI and Machine Learning
TeX
1
star