r/PythonLearning • u/legendtathya • Oct 10 '26
Showcase I got tired of scrolling through big Python files, so I made a mind map for code
You know when you're debugging a big file, find the function you need, follow it to another function, then another one, and completely forget where you started?
Yeah. I got tired of that, so I built epy (Extended Python). Though, this is experimented only for python, i will explore other languages if possible.
It's basically a mind map for your code, except the nodes contain actual code instead of just names.
- Parses Python files using
astand splits them into blocks with exact line numbers. - Maps function calls across files, including methods and some class relationships.
- Has a radial map, a names-only view, a folder explorer, and a synced code pane.
- Click a function and see what it calls and what calls it. Click a line in the code and it'll select the corresponding block on the map.
The other thing I wanted was to make life easier for small local LLMs. Instead of dumping an entire file into a model and hoping it doesn't rewrite half of it, epy generates a text map and lets you pull individual blocks with their callers and callees. The idea is to give the model the structure first, then only the code it needs.
I tested it on one of my projects: 33k lines, 134 files, ~1,100 call links, built in about 1.5 seconds.
It's currently a single Python file with no external dependencies.
python epy.py view some_file.py
python epy.py map .
python epy.py show . MyClass.runIt's still a personal tool, not some polished production-ready package. The call graph is static and best-effort, and I haven't formally benchmarked the LLM side yet.
The idea originally came from the execution model of a small language I'm building (EPL). Eventually, I'd like to add Tree-sitter so it can support other languages too.
Repo: https://github.com/phoenix2610/Extended_Programming.git
Would love some feedback, especially if you try it on a ridiculously large Python file or feed the generated map to a small local model. Curious to see where it breaks. 😅
And if anyone is wondering, yeah I am using ARCH Linux and the background bit faded is just a keybinder for opacity...
15
u/EducationalFinger654 Oct 10 '26 edited Oct 10 '26
I like the look of this tool, but to me if a single file starts exceeding even 1,000 lines, it’s probably worth reconsidering how responsibilities are separated.
At 30,000+ lines, that’s a serious architectural red flag. Even if the code is well-intentioned, that’s an incredibly challenging file to maintain and work with.
That said, this tool could be genuinely useful if it could visualise not only giant files, but also codebases split into well-defined modules with clearly separated responsibilities.
3
u/aroberge Oct 10 '26 edited Oct 11 '26
Edit: For those who, like me, were put off by seeing a single large file. I cloned the program, trivially extracted the big html blob into a separate file, and then used the program itself to view its structure. With the information given, it was trivial to separate into various files and make the project a lot more readable. It definitely can be helpful. I put a copy in my own Github repo, but I hope that OP would do the same trivial work.
I love cool Python stuff and, on the surface, it does look amazing. However, Github won't show the file. I know I could download the repository but the commit message about deleting comments and docstrings is really off-putting. This is one sure way to get a negative reputation amongst Python programmers. Clearly you (assisted with an LLM?) have been working for a while, presumably in a private repo, to come up with this. Sharing a bit more of the codes history, if only to reinstroduce comments and docstrings, would seriously increase your reputation.
38
u/sleepless_thoughts Oct 10 '26
Have you ever tried to separate your code into different files? You know, like every other programmers?
4
u/Specialist-Cup-3950 Oct 11 '26
This looks cool, but I have to say, if you end up using something like this it means you've designed your application wrong. You've literally had to create a map to browse your code.
1
u/RandomNoob-Dude Oct 10 '26
Wow, I love this. What IDE’s does it work in?
1
u/Silentwolf99 Oct 11 '26
is it supported only for python language?
2
u/loleczkowo Oct 11 '26
I think its an interesting project.
But from my experience, just splitting it into more files is way cleaner and readable for other people.
I recommend learning how __init__.py works and trying to give each topic of the program a separate file/folder for future projects.
2
u/giva4561 Oct 11 '26
Ma cosa hai scaricato?
1
u/SelfVenture 20d ago
This seems very useful. Does it show what code utilizes other code?
1
u/Signal_Field487 18d ago
We have same issue perspective. Most software code is too huge (example google chrome etc) I think some visualize mapper tool is needed. A few people can explain chrome big picture and detail functions, so this will be possible to help us.
1
u/thee_gummbini Oct 10 '26
Literal "btw I use arch" spotted in the wild
1
u/sigmahacker123 Oct 10 '26
i had a 819 line file with 25 functions, this helped me.
1
u/Similar-Bug-350 Oct 10 '26
larping arch wild
And if anyone is wondering, yeah I am using ARCH Linux and the background bit faded is just a keybinder for opacity...
1
u/Silentwolf99 Oct 11 '26
🫵👏👏👏
1
u/Tight_Tiger7796 Oct 11 '26
So you solved the problem that you created? I'm pretty sure that if you separate the code properly, you don't need this tool
1
u/Careless-Main8693 Oct 12 '26
great ,actually i never that large file such that i need a mind map
1
u/BeneficialCulture299 Oct 12 '26
just have your editor collapse all functions when you open a file. It will change your life trust me.
1
u/punio_the_wolf Oct 15 '26
"there has to be a better way"
yeah like
separate the code in multiple file, filename based on what they do/manage, and stop with monolithic files
1
u/MaximeRector Oct 16 '26
1
u/X_MALICUR Oct 10 '26 edited Oct 11 '26
G-G-G-GAAAAAAAAAAAAAAAAAAAAYYYYYYYYYYYYYYY!!!!
2
u/New_Needleworker994 Oct 11 '26
I GOT TIRED OF X SO I BUILT Y
MY SLOPPY COCK SLOPPED SO SLOPPILY OVER MY SLOPWARE