Skip to main content

Decorator for easy use PyCallGraph

Project description

Python Call Graph Decorator
#################

Welcome! Python Call Graph Decorator is a `Python <http://www.python.org>`_ module with decorator for easy and effective use pyCallGraph that creates `call graph <http://en.wikipedia.org/wiki/Call_graph>`_ visualizations for Python applications.

.. image:: https://img.shields.io/pypi/v/callgraphdecorator.svg
:target: https://pypi.python.org/pypi/callgraphdecorator

Quick Start
===========

Installation is easy as::

pip install pycallgraphdecorator

Or manually::

python setup.py install

Decorator is possible turn on permanently or switching ON/OFF via set system environment before start tracking application.

Decorator is write very effective! Condition if graph's are creating is evaluated only ones and if condition is off ten decorator only call method.

Decorator is possible set globally via system environment or locally via decorator parameters.

Output::

Each call decorated function create new graph in specific folder. Graphs are named as `function-name_graph-count.graph-type`

Possible system environment::

CREATE_CALL_GRAPH - set create graph On/Off - value True/False, true/false, 0/1 (can by set unique environment name for each decorator - state_setup_env params)
CALL_GRAPH_OUTPUT_PATH - set output path
CALL_GRAPH_OUTPUT_TYPE - set output type - for example "png" (NOT ".png"!!!)

Possible decorator parameters::

always_on=False - graph is crating always (environment CREATE_CALL_GRAPH isn't acceptable) - default False
output_folder - output folder - default "./call_graph/"
output_type - output graph type - default "png"
state_setup_env - enable set specific system environment for turning on/off creating graphs - default "CREATE_CALL_GRAPH"

Simple use of the decorator::

from callgraphdecorator import CallGraphDecorator

@CallGraphDecorator(True)
def test1():
print("Hello Word.")

if __name__ == '__main__':
test1() // output - ./call_graph/test1_0.png
test1() // output - ./call_graph/test1_1.png

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

callgraphdecorator-1.0.1.tar.gz (38.5 kB view details)

Uploaded Source

File details

Details for the file callgraphdecorator-1.0.1.tar.gz.

File metadata

File hashes

Hashes for callgraphdecorator-1.0.1.tar.gz
Algorithm Hash digest
SHA256 18b0f82b869cc88e290df273488f99c4b3b6c4411033cec1dcd98c9d7fa1c089
MD5 ae9de82c64f29cdef3c8408a07f67241
BLAKE2b-256 2d3b83895987a581f190ebcd9f8637670c5b3a784e79cff81a8a68a3738d9cef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page