Skip to main content

Tool that create a graph of code to show dependencies between code entities (methods, classes and etc).

Project description

badge1 badge2 badge3

Tool that create a graph of code to show dependencies between code entities (methods, classes and etc). CodeGraph does not execute code, it is based only on lex and syntax parse, so it not need to install all your code dependencies.


pip install codegraph

cg /path/to/your_python_code # path must be absolute

your_python_code - module with your python code

For example, if I put codegraph in my user home directory path will be:

cg /Users/myuser/codegraph/codegraph

Pass ‘-o’ flag if you want only print dependencies in console and don’t want graph visualisation

cg /path/to/your_python_code -o

If you want to change view and play with graph output - you can check ‘’ and play with matplotlib and networkX settings.

In default view - red line show dependencies between entities in different modules. Green - entities in module.

Graph visualisation Code with not used module Code there all modules linked together


  1. Create normal readme
  2. Add tests
  3. Add possibility to work with any code based (not depend on Python language only)
  4. Work on visual part of Graph (now it is not very user friendly)
  5. Add support to variables (names) as entities

Open PR with improvements that you want to add

If you have any questions - write me

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 codegraph, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size codegraph-0.0.5-py3-none-any.whl (1.0 MB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size codegraph-0.0.5.tar.gz (1.0 MB) 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