r/PythonLearning • • 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 ast and 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.run

It'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...

287 Upvotes

43 comments sorted by

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.

1

u/legendtathya Oct 10 '26

hey there, loved your take to this, and you are promptly correct too!! but when i say 30kloc, it was for the working directory itself... since my system is highly autonomous, breaking a module at 3k line would result in simpleton run time error... so i took the whole directory into account, so which exact module from which exact file is edited/imported can be seen as well...

currently this works fine for local LLM models to fix things like syntax error, indentation in a def function or incorrect variable name or calling.... so if an error occurs, simply forward the error and the said block in retrospect and fix them... SO far local LLM are not very good at pure generation of code so fixing a large line of code is feasible and saves tokens for the precious LLM subscriptions/plus this makes debugging and proofreading a lot more simpler too...

2

u/CrownstrikeIntern Oct 10 '26

Some ides have something similar built in too, saw one for phpstorm for example that was interesting 

1

u/supergnaw 23d ago

There's so many available, and most of them work in all JetBrains IDEs. One example, of probably hundreds, is CallTrail, which I think has the most visually appealing looking visualization, but there were some others that were probably more "usable" from an analyzing standpoint and focused less on making it pretty.

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.

1

u/legendtathya Oct 10 '26

Yes, i have been working for a new programminig language idea, a close mimic to that of python's high level language, the core idea for the language is to create a file, which has all the lists(kinda similar to python's docstring)... and i am thereby trying for couple of months to defeat pythons compile time.... but my Ast is quite simpleton so the implementation was not as par as i thought... later i had to confine myself with the usage of multi language assembly to execute a parallel compiler capabilities... IF I successfully do that, all the frontend,backend and DB could be written by a single language, which would compile all the terms and tokenise in the correct compiler

so a query like "show line chart with color red, blue"... can make a html file with a js process.... this is an example... the amount of line of code would drop significantly and debugging due to the "lists" which would act as the way the above EPY is acting would only point at the block of code which raised the error and any Small language model or local LLM would pick it up and with decent training fix that code without needing to load entire database...

I just transferred the concept to the existing GOAT language because lets be fair, i am more comfortable with python and python also needed it... As far as your concern for LLM assistance, yes, i used Claude to do that for me... it added comments for some reason so had to manually pull em out...

1

u/aroberge Oct 10 '26

Your entire goal sounded really ambitious ... and there's nothing wrong with that. I still think it would have been to your advantage to share publicly more of your work, perhaps writing down in Github issues your thoughts about how something should work and doesn't - at least not to your satisfaction. Perhaps you'd attract more attention and the help of contributors, which might help you learn what you need. This is something I did (before Github existed) some 22 years ago when I started on my first Python project.

it added comments for some reason so had to manually pull em out...

If it were me, I would have go through the comments and docstrings one by one, see if they made sense. If they did, I'd leave them in (perhaps rewriting them if it made it more clear). If they did not, I'd see if a better comment might have been warranted.

I suggest that you read this: https://news.berkeley.edu/2026/10/09/using-ai-for-just-10-minutes-erodes-your-ability-to-persist-at-hard-things/

1

u/legendtathya Oct 10 '26

You seem rather wise, Sir(apologies if its Ma'am)... I really appreciate your concern and rather have a long chat related to my said project... I am looking for contributors but any aspiration as of today is usually a pain... People are quick to dismiss an AI generated code h i guess is fair.... I am not checking moral queries but actually today i was in hurry for i am a student and didn't have enough time to manually write a code there....

If you dont mind, Are you open to discuss in DM....I'd rather not mention stuff in comments and elongate the thread further

1

u/aroberge Oct 10 '26

Feel free to email me - my github username is the same as my reddit user name.

38

u/sleepless_thoughts Oct 10 '26

Have you ever tried to separate your code into different files? You know, like every other programmers?

19

u/mattynmax Oct 11 '26

Careful critical thinking and planning ahead is hard for vibe coders.

4

u/PressF1ToContinue Oct 10 '26

This tool could be useful to decide how to separate a big file.

5

u/sleepless_thoughts Oct 10 '26

Yes. But this tool is redundant. Code should be separated from the start

6

u/PressF1ToContinue Oct 10 '26

Sometimes we inherit code.

3

u/CrownstrikeIntern Oct 10 '26

Everyone has to start somewhere. Not everyone is great in the beginning 

1

u/LouisPlay Oct 11 '26

i thought im the only one that does that!!! at work i regualiry see projects with 4500 Lines of code

1

u/WeakAd569 Oct 13 '26

No. Everything goes in main.py 😤

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?

3

u/legendtathya Oct 10 '26

If you follow the steps correctly and have python installed... Literally any IDE should do it... Even terminal is fine

1

u/Silentwolf99 Oct 11 '26

is it supported only for python language?

2

u/legendtathya Oct 11 '26

yes... i explictly have made this for python, though i will transition to other PL once i get more grip, because not all Languages have stack trace(the error pointing at the mistake), some just terminate the prcoess like C for example.... a different approaoch might be needed and i dont wanna sit with that trouble

1

u/baked_doge Oct 13 '26

I'm confused why you'd need to be using the debug/runtime utilities to do this. Wouldn't it make more sense to work with the language server protocol? It would allow your tool to work with every language out there too.

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?

2

u/giva4561 Oct 11 '26

Quali mod?

1

u/SelfVenture 18d ago

This seems very useful. Does it show what code utilizes other code?

1

u/Signal_Field487 16d 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/X_MALICUR Oct 10 '26 edited Oct 11 '26

G-G-G-GAAAAAAAAAAAAAAAAAAAAYYYYYYYYYYYYYYY!!!!

1

u/sambuchaaa Oct 11 '26

Wtf this was so uncalled for 😭😭

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