Show and Tell - Python Exploration Tool

Hello everyone! I wanted to share a tool that I have been working on related to object exploration in python.

This idea stems from my own curiosity about existing python packages both as a relative beginner and as someone who tends to want to know why something is the way that it is. When presented with new packages, I felt we generally have two options to learn about them: read the docs or explore the raw code. This tool is intended to live somewhere in the middle of those two options. My hope is to quickly answer questions like what are the basic parts of a package? What are all the functions or things that are available for a given object? How do the pieces fit together?

Oftentimes, the only reason we know about a certain class/function/method is because we had a direct need for it and googled a similar example. While useful in the moment, this can result in a lack of awareness for other potentially useful portions of the code. Having a tool that allows you to quickly scan through a listing of available things generally encourages further curiosity and understanding… this is my current goal.

Curious to see what people think and if this sort of tool would be useful to others. This is a different kind of app than what I have seen in the gallery for the most part, but definitely open to sharing if there is interest. Definitely couldn’t have done this without Dash and the fantastic community components available out there! I used a lot of them :slight_smile:

Deployed Server Link (for now):
https://python-explorer.onrender.com

Source Code:
https://github.com/nelsonseth/python-explorer

The github readme file has an about section with some example gifs and some more information about the basic functionality of the tool.

9 Likes

Hi @nelsonseth and wecome to the Dash community :slightly_smiling_face: :

This is cool project! :sunglasses: and impressive too! Hard to believe you consider yourself a “relative beginner” .

It’s a super fast way to look up prop names and attributes from a bunch of different libraries. I could see keeping your site open all the time when I’m coding.

If you continue to add new features, I think it would be handy to have a link back to the library’s docs (unless you have that already and I missed it)

2 Likes

Thanks @AnnMarieW ! This is my first venture into dash and I’ve only been using python for a few years. Didn’t know anything about css or html, so it felt like every step was a steep learning curve, but I got there in the end. I think there’s a lot to be said about the dash community and the great resources available.

I really like your idea of providing a direct link to the current library’s main docs. That should be fairly easy to implement in this setup.

2 Likes

This is such a cool tool to have. Thanks for building and sharing with us, @nelsonseth . Now we just have to add the Plotly package :slight_smile:

This tool makes discovering the features of certain packages a lot easier. I’m thinking for scalability purposes, would there be a way to allow others to add packages to the common data libraries dropdown?

1 Like

Thanks @adamschroeder ! Yes, plotly for sure haha.

I definitely think having the ability for users to add in their own packages of interest would be ideal and make it more useful for a wider audience. I’ve been thinking about it a lot actually and I currently don’t see how that option would be possible using the regular server as is, but this is beyond my knowledge base.

Originally, I built the dash portion of this within a class so I could operate on the methods of a single instance of my custom explore class. This worked really well, but it broke the “no globals” rule about 10x over. I rebuilt it from the ground up in order to make it stateless, but one of the concessions I made was to import everything in the accordion lists upfront, which could get quite heavy for longer and longer lists.

I am currently thinking this may make more sense as a tool that is run locally. If it could be available as a normal package and then have the user run the app (maybe from the CLI) using the local host, the tool could potentially create the package listings from the current standard libs and site-packages of that environment. In this way, the listing would be unique and relevant for each user. Since the tool is just inspecting the current code, the results would be specific to whatever package versions they have installed as well. Again, I am talking about things that I have no idea how to do yet, but what do y’all think?

2 Likes

Hi all!

I wanted to post a quick update to this project. I have been working to make this tool more stand-alone and relevant for a wider audience. To me, this meant allowing users to run the tool locally and operate on all of the package information from their own environment. So now, in addition to some improvements and a facelift, an initial release of python-explorer is now available on pypi and can be installed via pip!

> pip install python-explorer

Included in the package is a script that can be run from the cli and will launch the tool in the browser.

> python-explorer
Exploring: Python Explorer started on 'http://127.0.0.1:8080/
Exploring: Number of threads: 8
Exploring: Press Ctrl+C to terminate

An online demo version of the updated tool is still available through the render link: demo

As always, the source code and more info from the README can be found in the github repo: Github - python-explorer

2 Likes