Skip to main content

Prints function calls of the Python program

Project description

# PyTracer

Prints function calls of the Python program.

$ cat
def f(a):
return g(a, "20")

def g(a, b):
return b, a


$ pytracer
>example.g(10, '20') = ('20', 10)
<example.f(10) = ('20', 10)
<example.<module>() = None

## Installing ##

`pip install pytracer`

## Usage ## [-h] [-s S] [-i I] [-f F] filename ...

positional arguments:
filename a name of the Python program

optional arguments:
-h, --help show this help message and exit
-s S max argument length to print (the default is 32)
-i I modules to ignore (comma delimited, the default is
-f F modules to focus at (comma delimited)

## Advanced Usage ##

If you want to trace a single function just add the trace() decorator. Also it is possible to ignore not interesting subcalls:

import pytracer

def g():
return 42

def f():
return g()


The module also can be used as a context manager:

import pytracer

def f():
return 42

with pytracer.trace():

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytracer, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size pytracer-0.0.4.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page