Skip to main content

Code that graphs code

Project description

https://travis-ci.org/LaurEars/codegrapher.svg?branch=master

Code that graphs code

Uses the python AST to parse Python source code and build a call graph.

Output

An example of the current output of the parser parsing itself.

parser.py

Installation

pip install codegrapher

To generate graphs, graphviz must be installed.

Usage

At the command line

To parse a file and output results to the console:

codegrapher path/to/file.py --printed

To parse a file and output results to a file:

codegrapher path/to/file.py --output output_file_name --output-type png

As a Python module

To easily parse code in Python :

from codegrapher.parser import FileVisitor

with open('path/to/file.py', 'r') as input_file:
    parsed_code = ast.parse(code.read())
visitor = FileVisitor()
visitor.visit(parsed_code)

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 codegrapher, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size codegrapher-0.1.3.tar.gz (6.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page