MCPcopy Index your code
hub / github.com/IyadhKhalfallah/Code2Flowchart

github.com/IyadhKhalfallah/Code2Flowchart @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
26 symbols 104 edges 22 files 4 documented · 15%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Code2Flowchart

Code2Flowchart is a Python package that generates a flowchart from a given code in any programming language. With Code2Flowchart, you can easily visualize the control flow of your code and identify any potential issues.

Usage

To use Code2Flowchart, you will need to set your personal GitHub access token and OpenAI API key as environment variables. Once you have done this, you can run the main.py file and update it to be adapted to the GitHub repo you want to generate flowcharts from. The output will be a flowchart for every file you have in your repo.

If you want to directly inject a piece of code instead of giving a repo, you can run playground.py, which will run a Streamlit playground to add your code and generate a flowchart from it.

To get started, make sure you have installed all the dependencies by running:

pip install -r requirements.txt

Environment Variables

You will need to set the following environment variables before using Code2Flowchart:

  • GITHUB_ACCESS_TOKEN: Your GitHub access token, which you can obtain from your GitHub account settings.
  • OPENAI_API_KEY: Your OpenAI API key, which you can obtain from the OpenAI website.

Contributing

Contributions are welcome! If you have any suggestions or issues, please open an issue or pull request on the GitHub repo.

License

Code2Flowchart is licensed under the MIT License. See the LICENSE file for more information.

Core symbols most depended-on inside this repo

generate_flowchart
called by 4
code2flowchart/utils/flowchart/mermaid.py
flowchart_template
called by 4
code2flowchart/templates/prompt.py
generate_output
called by 1
code2flowchart/playground.py
main
called by 1
code2flowchart/playground.py
async_generate_output
called by 1
code2flowchart/generators.py
run
called by 1
code2flowchart/main.py
async_generate
called by 1
code2flowchart/utils/asyncllm/AsyncFlowGenerator.py
generate_concurrently
called by 1
code2flowchart/utils/asyncllm/AsyncFlowGenerator.py

Shape

Function 12
Method 10
Class 4

Languages

Python100%

Modules by API surface

code2flowchart/utils/asyncllm/AsyncFlowGenerator.py4 symbols
code2flowchart/utils/asyncllm/AbstractAsyncLLM.py4 symbols
code2flowchart/tools/FlowchartGenTool.py3 symbols
code2flowchart/tools/CodeExplanationTool.py3 symbols
code2flowchart/playground.py3 symbols
code2flowchart/utils/asyncllm/helpers.py2 symbols
code2flowchart/generators.py2 symbols
code2flowchart/utils/flowchart/mermaid.py1 symbols
code2flowchart/utils/extractors/githubextractor.py1 symbols
code2flowchart/templates/prompt.py1 symbols
code2flowchart/templates/flowchart_prompt.py1 symbols
code2flowchart/main.py1 symbols

For agents

$ claude mcp add Code2Flowchart \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact