CoolFace
Apppublic

cyyeh/py-code-analyzer

sourceHugging Facemitupdated 4y agoView on Hugging Face
0likes
README.md55 linesDownload Raw Back to root
1---2title: Py Code Analyzer3emoji: ๐Ÿ“ˆ4colorFrom: red5colorTo: yellow6sdk: streamlit7sdk_version: 1.9.08app_file: app.py9pinned: false10license: mit11---12 13Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference14 15# Python Code Analyzer16 17## Motivation18 19The main purpose of the app is to allow Python developers navigate Python code base much easier by showing dependencies20among files included in the directory with better visualization.21 22## Setup23 24- `pipenv install -r requirements.txt --python=3.8`25- `cp .env.example .env`: fill in your GitHub username and personal access token if you need to increase [GitHub API requests rate limiting](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting)26- `make run`27 28## Used technologies29 30- `networkx`: network analysis31- `pyvis`: network visualization32- `aiohttp`: asynchronous HTTP client33- `pybase64`: faster base64 encoding/decoding34- `streamlit`: web app35 36## TODOs37 38- [x] Build a prototype39  - [x] Finish `generate_imports_graph` implementation40  - [x] Fetch python files given public GitHub repo url(owner, repo, path, ref)41  - [x] Use `ast` to parse imports among given python files42  - [x] Generate a basic `networkx` graph given python imports43  - [x] Visualize a basic `networkx` graph using `pyvis`44- [x] Build a `streamlit` app45- [ ] Performance optimization46  - [x] `requests` to `aiohttp`47  - [x] change fetching GitHub repository content api from preventing querying multiple times48  - [ ] ...49- [ ] Network analysis50- [ ] Enhance network visualization UI51## References52 53- [How to set up a perfect Python project](https://sourcery.ai/blog/python-best-practices/)54- [Benchmark of popular graph/network packages](https://www.timlrx.com/blog/benchmark-of-popular-graph-network-packages)55- [Asynchronous HTTP Requests in Python with aiohttp and asyncio](https://www.twilio.com/blog/asynchronous-http-requests-in-python-with-aiohttp)