Giter Club home page Giter Club logo

objbrowser's Introduction

objbrowser

Python object browser implemented in Qt.

Shows an object in a tree view so that you can examine its attributes recursively (e.g. browse through a list of dictionaries).

From the View menu you can select some extra columns, for instance the object ID column.

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.

objbrowser screen shot

Installation:

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

  2. Run the installer:

    %> sudo python setup.py install
    

Usage examples:

To examine a dictionary (or any other Python object):

from objbrowser import browse
d = {'hello': 'hallo', 'world': 'wereld'} 
browse(d, obj_name='d')

If you omit the obj_name parameter, the path column will not start with the object name but with the item names.

To pause program execution and examine all local variables:

from objbrowser import browse
from datetime import datetime

def my_fun():
    now = datetime.utcnow()
    browse(locals())

my_fun()

To open two object browser windows simultaneously:

from objbrowser import create_object_browser, execute

# Make sure to keep the (loc_browser and glb_browser) references until
# execute() has finished. Otherwise the windows will be garbage-collected.
loc_browser = create_object_browser(locals(), obj_name = 'locals()')
glb_browser = create_object_browser(globals(), obj_name = 'globals()')
execute()

If the show_special_methods parameter is False, the objects special methods, i.e. methods with a name that starts and ends with two underscores, will be hidden.

If the show_root_node parameter is False (the default), the attributes of the object will be placed as top level items in the tree. Otherwise, the a single node with of the object will be the top level item.

If the width and height parameters are given, the window will be resized.

from objbrowser import browse

browse(range(0, 10), obj_name='list', 
       show_special_methods = False,
       show_root_node = True, 
       width = 1000, height = 600) 

objbrowser's People

Contributors

titusjan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

anubhab91

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.