Skip to content
GUI for Python object introspection
Python Other
  1. Python 99.8%
  2. Other 0.2%
Branch: master
Clone or download
Latest commit deb887f Jul 5, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Merge branch 'devel' into qt5 Oct 30, 2016
objbrowser
.gitignore Ignore Pycharm files Jul 5, 2018
CHANGES.txt Set program version to 1.2.1rc1 Nov 2, 2016
LICENSE.txt Switched to the MIT license (was GPL v3) so it can be used by the Spy… Oct 1, 2016
MANIFEST.in Added classifiers and MANIFEST.in Mar 30, 2014
README.md Program version == 1.2.1 Nov 5, 2016
README.txt Resizeable error dialog. Oct 30, 2016
columns.md
create_python_installer.bat Version 0.9.2 Dec 9, 2013
screen_shot.png Screenshot contains unicode column instead of summary Apr 1, 2014
setup.py Program version == 1.2.1 Nov 5, 2016
use_this_source_tree.sh Using qtpy to make it work for PyQt5, PyQt4 and PySide. Oct 8, 2016

README.md

objbrowser

Extensible Python object inspection tool implemented in Qt.

Displays objects as trees and allows you to inspect their attributes recursively (e.g. browse through a list of dictionaries). You can add your own inspection methods as new columns to the tree view, or as radio buttons to the details pane. Altering existing inspection methods is possible as well.

Installation:

First install PyQt or PySide

The object browser automatically detects which Qt bindings are installed. If both bindings are installed it prefers PyQt over PySide. You can force the object browser to use a certain binding by setting the QT_API environment variable to pyqt5, pyqt4, or pyside.

Also install six:

%> pip install six

Then install the object browser with:

%> pip install objbrowser

or use the installer:

%> python setup.py install

User interface:

objbrowser screen shot

From the View menu you can select some extra columns, for instance the object's id column. This can also be done by right-clicking on the table header. An overview of the available columns, and their meanings, can be found in here.

Callable objects (typically functions, methods and classes) are displayed in blue. Objects that are an attribute of their parent (as opposed to a list element or dictionary item) are displayed in italics.

If Show callable attributes from the View menu is checked, objects that are callable and are an attribute are shown. Otherwise they are hidden.

If Show special attributes from the View menu is checked, objects that are attributes, and have a name that starts and ends with two underscores, are shown. Otherwise they are hidden.

The details pane at the bottom shows object properties that do not fit on one line, such as the docstrings and the output of various functions of the inspect module from the Python standard library.

Usage examples:

The first parameter is the object to be inspected. For example you can examine the dictionary with the local variables:

from objbrowser import browse
a = 67; pi = 3.1415 
browse(locals())

The second parameter can be the name of the object. In that case the object itself will be displayed in the root node.

browse(locals(), 'locals()')

By setting the show_callable_attributes and/or the show_special_attributes parameters you can override the settings from the View menu. The reset parameter resets the persistent window settings (e.g. size and position)

s1 = 'Hello'
s2 = 'World'

browse({'s1': s1, 's2': s2}, 
        show_callable_attributes = True,
        show_special_attributes = False, 
        reset = True)

Some complete examples can be found in the examples directory. E.g.:

You can’t perform that action at this time.