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 hashes)

Uploaded Source

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