cyyeh / py-code-analyzer

The main purpose of the app is to allow Python developers navigate Python code base much easier by showing dependencies among files included in the directory with better visualization.

Home Page:https://share.streamlit.io/cyyeh/py-code-analyzer/main/app.py

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

title emoji colorFrom colorTo sdk sdk_version app_file pinned license
Py Code Analyzer
📈
red
yellow
streamlit
1.9.0
app.py
false
mit

Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference

Python Code Analyzer

Motivation

The main purpose of the app is to allow Python developers navigate Python code base much easier by showing dependencies among files included in the directory with better visualization.

Setup

  • pipenv install -r requirements.txt --python=3.8
  • cp .env.example .env: fill in your GitHub username and personal access token if you need to increase GitHub API requests rate limiting
  • make run

Used technologies

  • networkx: network analysis
  • pyvis: network visualization
  • aiohttp: asynchronous HTTP client
  • pybase64: faster base64 encoding/decoding
  • streamlit: web app

TODOs

  • Build a prototype
    • Finish generate_imports_graph implementation
    • Fetch python files given public GitHub repo url(owner, repo, path, ref)
    • Use ast to parse imports among given python files
    • Generate a basic networkx graph given python imports
    • Visualize a basic networkx graph using pyvis
  • Build a streamlit app
  • Performance optimization
    • requests to aiohttp
    • change fetching GitHub repository content api from preventing querying multiple times
    • ...
  • Network analysis
  • Enhance network visualization UI

References

About

The main purpose of the app is to allow Python developers navigate Python code base much easier by showing dependencies among files included in the directory with better visualization.

https://share.streamlit.io/cyyeh/py-code-analyzer/main/app.py


Languages

Language:Python 74.8%Language:HTML 16.8%Language:Makefile 8.3%Language:Shell 0.0%