_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
which would expand to:
variable type value
a A
+-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_
_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
_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
_From pierre.raybaut on 2011-02-28T06:44:20Z_
issue #291 has been merged into this issue.
_From [email protected] on 2012-01-04T11:44:29Z_
Any update on that feature request?
_From pierre.raybaut on 2012-01-07T04:40:07Z_
Nothing new except for revision 6a1d3e40eed8 .
_From pierre.raybaut on 2012-03-18T14:11:55Z_
Labels: -Type-Enhancement Type-Defect
_From pierre.raybaut on 2012-03-18T14:12:14Z_
Labels: -Type-Defect Type-Enh
_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
_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
_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
_From ccordoba12 on 2014-11-18T18:03:19Z_
issue #1887 has been merged into this issue.
_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
_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 :-)
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!
Has been this feature implemented already?
I understand that this is something similar to what this module does: https://github.com/titusjan/objbrowser
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 ?
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?
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 ;-)
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, glad to know you're interested in collaborating with us! PyQt has an exception clause to this rule, which makes applications built with it to use the license they want (as long as it's compatible with the GPL)
We use that exception to license Spyder as MIT :-)
Can you provide a link to that exception clause?
https://gist.github.com/takluyver/f7d95b0354a01bae2428
It come with tar/zip whe downloading the pyqt zip/tar
The GPL_EXCEPTION.TXT seems to have been removed since 4.11.4. It is not present anymore when I download PyQt-x11-gpl-4.11.4.tar.gz (it was however present in 4.11.3).
When I look at the change-log it says: "Aligned the GPL licensing with Qt"
The only other information I could find on this was this post, which seems to confirm that it was done to align it with the Qt license.
It looks like the exception was removed without announcing it or discussing it with the community. Anyway, I'm not sure that I can release under the MIT with the latest version of PyQt.
The easiest way to confirm this is to write on the mailing list, but "Aligned the GPL licensing with Qt" means that it is also LGPL (as Qt?)
In which case for this case
A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
Would be fine, no @ccordoba12 ?
Yes, it's fine. @titusjan, please also see this answer from Phil Thompson, the author of PyQt:
https://riverbankcomputing.com/pipermail/pyqt/2014-February/033848.html
@titusjan, so have you considered relicensing your package?
Yes I did, sorry for the late reply.
I am not satisfied with the answer of Phil Thompson on the PyQt mailing list. He says that the MIT license is compatible with the GPL and therefore the exception is not needed. However, according to the GPL FAQ, being compatible with the GPL means that you need to release your software under the same version of the GPL.
"they also permit distribution of such combinations provided the combination is released under the same GNU GPL version. The other license is compatible with the GPL if it permits this too."
This is the viral nature of the GPL. I therefore think the exception is still necessary. So, if you don't mind, I'd like to ask for clarification on the PyQt mailing list.
@titusjan sure, go ahead please.
I asked my question here: https://www.riverbankcomputing.com/pipermail/pyqt/2016-September/038126.html
I got an answer from Phil on the mailing list. He didn't address the exception but told me that: if I want to distribute my code together with PyQt I would need the GPL, but if I distribute my code without PyQt, and let users download it separately, I can use the MIT.
So that's good enough for me. I will try to make a release this week (probably will be on Saturday though).
Thanks @titusjan!
Made an MIT release: objbrowser v1.1.0
Use whatever you like from it. Let me know if you have questions or remarks.
Great! Thanks @titusjan
Yep, thanks a lot!
@rlaverde could you work on this?
We can set up a meeting to go through the current architecture of the varexp and the needs
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.
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?
It was a mistake.
@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!
Most helpful comment
Made an MIT release: objbrowser v1.1.0
Use whatever you like from it. Let me know if you have questions or remarks.