Skip to main content
# PyTracer

Prints function calls of the Python program.

```console
$ cat example.py
def f(a):
return g(a, "20")

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

f(10)

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

## Installing ##

`pip install pytracer`

## Usage ##

pytracer.py [-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
re,glob,random,codecs,argparse)
-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:

```python
import pytracer

@pytracer.no_trace()
def g():
return 42

@pytracer.trace()
def f():
return g()

f()
```

The module also can be used as a context manager:

```python
import pytracer

def f():
return 42

with pytracer.trace():
f()
```

Metadata

Release files for pytracer 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytracer 0.0.4
File Size Uploaded Provenance
pytracer-0.0.4.tar.gz 4.7 kB Without provenance Details

Release files / pytracer-0.0.4.tar.gz

Download URL pytracer-0.0.4.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5bd85a8a5a91c3da725d6fcda50ef9cad7ee3d0b988ba247b4c40c98e11ceaf1
BLAKE2b-256 checksum
How to use checksums
edfff4816f9fc960e466053d70aa1d76e1cb3628ceddee858f439754e882bf35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

Security for pytracer 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page