Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Object Explorer for exploring an object's properties #558

Closed
spyder-bot opened this issue Feb 16, 2015 · 39 comments · Fixed by #8852
Closed

Add Object Explorer for exploring an object's properties #558

spyder-bot opened this issue Feb 16, 2015 · 39 comments · Fixed by #8852

Comments

@spyder-bot
Copy link
Collaborator

From [email protected] on 2011-02-11T18:15:26Z

Please add a tree-view of the currently-available objects and their properties.
e.g. given a class A with properties b and c, and an instance of class A called a, there would be a collapsible entry:

variable type value
a A <whatever repr(a) gives>

which would expand to:

variable type value
a A <whatever repr(a) gives>
+-b str hello
+-c str world

(a good example is in wxPython's PyCrust shell - the Namespace explorer)

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=558

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2011-02-16T11:56:34Z

This idea sounds very interesting. Although I understand you perfectly well, could you put a PyCrust screenshot depicting this feature? I've tried to find it but it seems like an old project.

Thanks for your interest in Spyder,
Carlos

Labels: -Type-Defect Type-Enhancement

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2011-02-17T21:46:36Z

PyCrust comes as part of wxPython. In the namespace explorer it starts with a node for locals, which can be expanded to show the current set of local variables. From there you can expand certain variables to examine their properties and methods. When you select a variable (or property or method) it displays some information about that object (e.g. docstring, repr(...), str(...)).
To reduce clutter, I would suggest to limit what is displayed to "public" (non-underscore) variables and properties.

Attachment: pycrust_namespace.png

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2011-02-28T06:44:20Z

issue #291 has been merged into this issue.

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-01-04T11:44:29Z

Any update on that feature request?

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-01-07T04:40:07Z

Nothing new except for revision 6a1d3e40eed8 .

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-03-18T14:11:55Z

Labels: -Type-Enhancement Type-Defect

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-03-18T14:12:14Z

Labels: -Type-Defect Type-Enh

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2013-06-30T11:58:12Z

I made my own tree view PyQt script that does this. It's a standalone script, but feel free to modify it for use as a plugin in Spyder. The code is slightly messy since I was learning PyQt along the way. Here is the description:

Features:
represents objects in a namespace as a tree with subitems for:
-user created classes/instances with dict
-mapping-like objects (e.g. dicts, pandas objects)
-sequence-like objects (e.g. lists, numpy arrays)
copy names of objects to clipboard
natural sorting of tree
circular references detection
note: uncomment app.exec_() and def closeEvent for a proper application, but blocks terminal
Todo:
auto refresh
app.exec_() without blocking the terminal

Attachment: objectexplorer.py objectexplorer_ui.ui objectexplorer_ui.py Screenshot.png

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-07-04T10:37:40Z

Thanks a lot for sharing your work with us!! That's the spirit of open source!

I don't have time to review your work right now (because we are busy with our Python 3 migration) but I'll do it in a month or so, after we release 2.3.

Thanks again

Labels: MS-v2.4 Cat-VariableExplorer

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2013-07-11T19:14:20Z

Glad to help! I attached an updated version of the main script that fixes a few things.

Attachment: objectexplorer.py

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-11-18T18:03:19Z

issue #1887 has been merged into this issue.

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2015-02-03T07:11:17Z

[email protected] how do I use this plugin for a project in Spyder? This is a really nice feature you have made.

Ts

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2015-02-03T12:19:13Z

I hope to have time integrate climan99 work in our next major release. I think it shouldn't be that hard to do :-)

@simongis
Copy link

simongis commented Jan 5, 2016

Have jumped into learning python with Conda install and using Spyder as my IDE. Loving it so far (former PyScripter user). Just been learning more about classes and was bit stumped why I could not see them in variable explorer. I know GitHub does not allow for voting on issues, but just raising my hand up on this one. Keep up the great work!

@franktoffel
Copy link

franktoffel commented Sep 12, 2016

Has been this feature implemented already?

I understand that this is something similar to what this module does: https://github.com/titusjan/objbrowser

@goanpeca
Copy link
Member

We are working on this, but will not be available for 3.0, more like 3.2 version.

Very cool project you linked. Could be useful, @ccordoba12 ?

@ccordoba12 ccordoba12 modified the milestones: v3.1, v3.2 Sep 12, 2016
@ccordoba12
Copy link
Member

Yes, I'm very much in favor of adding something like this to visualize all types we don't support natively (e.g. functions and classes).

Unfortunately @titusjan code is GPL3. @titusjan, could you reconsider to re-license it as MIT?

@ccordoba12
Copy link
Member

Another (important) thing to notice is that to expand the Variable Explorer to handle arbitrary objects, we need to use a serialization library that can handles all Python objects (pickle fails a bit short at that). And the most robust one that does this is dill.

Another really cool thing about dill is that it allows to save a full interpreter session to disk. So by using it we'll also be able to save the state of our consoles and restore it at will (pretty much as RStudio does it for R ;-)

@titusjan
Copy link

In principle I wouldn't mind re-licensing objbrowser under MIT. However, the new version (i.e. the current development branch) works with both PyQt and PySide. Since PyQt is GPL, it is my understanding that it makes objbrowser incompatible with the MIT license.

Perhaps I could release it under a dual license of some sorts. Any thoughts on this?

@titusjan
Copy link

titusjan commented Oct 1, 2016

Made an MIT release: objbrowser v1.1.0
Use whatever you like from it. Let me know if you have questions or remarks.

@franktoffel
Copy link

Great! Thanks @titusjan

@ccordoba12
Copy link
Member

Yep, thanks a lot!

@ccordoba12 ccordoba12 modified the milestones: v3.1, v3.2 Oct 15, 2016
@goanpeca
Copy link
Member

@rlaverde could you work on this?

We can set up a meeting to go through the current architecture of the varexp and the needs

@ccordoba12
Copy link
Member

If the plan is to work on the Variable Explorer API, we should move this to 4.0. However, that's not needed to add a general objects browser (at least for Python) in 3.0.

@tpanza
Copy link

tpanza commented Jan 3, 2019

Hi, just curious on the latest status on this. May I ask why this is "not sorted" and apparently no longer scheduled for inclusion in Spyder 4.0?

@ccordoba12 ccordoba12 modified the milestones: not sorted, v4.0beta3 Jan 3, 2019
@ccordoba12
Copy link
Member

It was a mistake.

@ccordoba12 ccordoba12 assigned dalthviz and unassigned rlaverde Feb 10, 2019
@ccordoba12
Copy link
Member

@dalthviz, please work on this one. Move everything we need from the objbrowser project to a new module called plugins/variableexplorer/widgets/objecteditor2/, add some tests for it and make it work with arbitrary objects (i.e. not collections, arrays or dataframes). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants