• Stars
    star
    309
  • Rank 134,537 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

CodeGraph - static code analyzator, that create a diagram with your code structure.

badge1 badge2 badge3workflow

Tool that create a digram with your code structure to show dependencies between code entities (methods, modules, classes and etc). Main advantage of CodeGraph, that is does not execute the code itself. You not need to activate any environments or install dependencies to analyse the target code. It is based only on lex and syntax parse, so it not need to install all your code dependencies.

Install codegraph

  
    pip install codegraph

Analyze your code

codegraph - name of command line tool for CodeGrapg

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

    # or for one file

    codegraph /path/to/your_python_code

your_python_code - module with your python code

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

codegraph /Users/myuser/codegraph/codegraph

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

codegraph /path/to/your_python_code -o

If you want to change view and play with graph output - you can check 'vizualyzer.py' and play with matplotlib and networkX settings.

Colors meanings

In default view - red line show dependencies between entities in different modules. Green - links between objects/functions inside same module.

Graph visualisation

 Code with not used module

Code there all modules linked together

TODO

1. Create normal readme
2. Add tests
3. Work on visual part of Graph (now it is not very user friendly)
4. Add support to variables (names) as entities
5. Split usage & inheritance as a different cases

Changelog

v0.1.0

Improvements

  1. Command line tool name changed from 'cg' to 'codegraph'.
  2. Updated versions of dependencies
  3. Minimal supported python version up to 3.8
  4. Added some unit & functional tests

More Repositories

1

airflow_in_docker_compose

Apache Airflow in Docker Compose (for both versions 1.10.* and 2.*)
Python
184
star
2

simple-ddl-parser

Simple DDL Parser to parse SQL (HQL, TSQL, AWS Redshift, BigQuery, Snowflake and other dialects) ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc. & table properties, types, domains, etc.
Python
172
star
3

omymodels

O!My Models (omymodels) is a library to generate Pydantic, Dataclasses, GinoORM Models, SqlAlchemy ORM, SqlAlchemy Core Table, Models from SQL DDL. And convert one models to another.
Python
164
star
4

gino-admin

Admin Panel for GinoORM - ready to up & run (just add your models)
Python
49
star
5

laziest

Work in Progress: Package that trying to generate unit tests from code
Python
18
star
6

py-models-parser

Parser for Different Python Models (pure Python classes, Pydantic, Enums, ORMs: DjangoORM, Tortoise, SqlAlchemy, GinoORM, PonyORM, Pydal) to extract information about columns(attrs), model, table args,etc in one format.
Python
16
star
7

airflow_examples

Airflow Examples: code samples for Medium articles
Python
12
star
8

lof

AWS Lambdas on FastAPI for local run & test (based on AWS Code Deploy template)
Python
7
star
9

big-parsers-generators-comparison

A code snippet repository that provides examples of how to use different syntax parser generator libraries. And some useful links in README.
Python
7
star
10

table-meta

Table Meta standard that used in fakeme library & OmyModels to unify data mapping for ORM, Python Models & ddl data
Python
4
star
11

fakeme

Flexible, customizable data generator for relational data
Python
4
star
12

sqlalchan

Customising SQLALchemy' Class definition with inheriting from DeclarativeMeta Class.
Python
4
star
13

simple-ddl-generator

(pretty fresh) Generate SQL DDL from simple-ddl-parser data & various Python models (pydantic, dataclasses, python enums, etc)
Python
4
star
14

py-module-parser

Python Module Parser is a library that parses Python modules and outputs information about imports, functions, variables, and their corresponding line numbers.
Python
3
star
15

airflow-helper

Airflow Helper is a tool that currently allows setting up Airflow Variables, Connections, and Pools from a YAML configuration file. Support yaml inheritance & can obtain all settings from existed Airflow Server!
Python
3
star
16

pypi_tools_bot

PyPi Tools Bot for Telegram (@pypi_tools_bot) - subscribe to get updates about new releases of your favorite packages, search packages, get downloads statistics
Python
2
star
17

airflow_lectures

Python
2
star
18

clifier

Argparse's commands generator from yaml file
Python
1
star
19

piter_py_2020_apache_airflow

PiterPy 2020: Apache Airflow Workshop
Python
1
star