Skip to content

lebedov/objbrowser

 
 

Repository files navigation

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:

  1. Install PySide: http://qt-project.org/wiki/Category:LanguageBindings::PySide

  2. Run the installer:

    %> pip install objbrowser
    

User interface:

objbrowser screen shot

From the View menu you can select some extra columns, for instance the objects' id column. This can also be done by right-clicking on the table header.

If the Show routine attributes from the View menu is checked, functions and methods that are attributes of the object are shown, otherwise they are hidden. Routines that are not an object attribute, for instance functions that are an element in a list, are always displayed.

If the Show special attributes from the View menu is checked, attributes whos name start and end with two underscores are displayed.

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_routine_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_routine_attributes = True,
        show_special_attributes = False, 
        reset = True)

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

About

Python object browser implemented in Qt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.9%
  • Shell 0.1%