Skip to main content

Python Object Graphs

objgraph is a module that lets you visually explore Python object graphs.

You’ll need graphviz if you want to draw the pretty graphs.

I recommend xdot for interactive use. pip install xdot should suffice; objgraph will automatically look for it in your PATH.

Installation and Documentation

pip install objgraph or download it from PyPI.

Documentation lives at http://mg.pov.lt/objgraph.

History

I’ve developed a set of functions that eventually became objgraph when I was hunting for memory leaks in a Python program. The whole story – with illustrated examples – is in this series of blog posts:

Support and Development

The source code can be found in this Bazaar repository: https://code.launchpad.net/~mgedmin/objgraph/trunk.

To check it out, use bzr branch lp:objgraph.

Report bugs at https://bugs.launchpad.net/objgraph.

Changes

1.5.0 (2010-12-05)

Show frame objects as well (fixes LP#361704).

New functions: show_growth, show_chain.

find_backref_chain returns [obj] instead of None when a chain could not be found. This makes show_chain(find_backref_chain(...), ...) not break.

Show how many references were skipped from the output of show_refs/show_backrefs by specifying too_many.

Make show_refs descend into modules.

Do not highlight classes that define a __del__, highlight only instances of those classes.

Option to show reference counts in show_refs/show_backrefs.

Add Sphinx documentation and a PyPI long description.

1.4.0 (2010-11-03)

Compatibility with Python 2.4 and 2.5 (tempfile.NamedTemporaryFile has no delete argument).

New function: most_common_types.

1.3.1 (2010-07-17)

Rebuild an sdist with no missing files (fixes LP#606604).

Added MANIFEST.in and a Makefile to check that setup.py sdist generates source distributions with no files missing.

1.3 (2010-07-13)

Highlight objects with a __del__ method.

Fixes LP#483411: suggest always passing [obj] to show_refs, show_backrefs, since obj might be a list/tuple.

Fixes LP#514422: show_refs, show_backrefs don’t create files in the current working directory any more. Instead they accept a filename argument, which can be a .dot file or a .png file. If None or not specified, those functions will try to spawn xdot as before.

New extra_info argument to graph-generating functions (patch by Thouis Jones, LP#558914).

setup.py should work with distutils now (LP#604430, thanks to Randy Heydon).

1.2 (2009-03-25)

Project website, public source repository, uploaded to PyPI.

No code changes.

1.1 (2008-09-10)

New function: show_refs for showing forward references.

New functions: typestats and show_most_common_types.

Object boxes are less crammed with useless information (such as IDs).

Spawns xdot if it is available.

1.0 (2008-06-14)

First public release.

Metadata

Release files for objgraph 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for objgraph 1.5.0
File Size Uploaded
objgraph-1.5.0.tar.gz 401.8 kB Details

Release files / objgraph-1.5.0.tar.gz

Download URL objgraph-1.5.0.tar.gz
Size 401.8 kB
Tags Source
SHA-256 checksum
How to use checksums
aa6c52a5b921983667ea253a3a5cbf29c6f387fe88dc24085afec5745ad32e55
BLAKE2b-256 checksum
How to use checksums
a8da0309330b82af1183d54d35709685a30ce5d3c6a3adf2acc7f00a93476194
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

3.6.2

2 release files

3.6.1

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.1

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.8.1

1 release file

1.8.0

2 release files

1.7.2

1 release file

1.7.1

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.5.1

1 release file

This release

1.5.0 This release

1 release file

1.4.0

1 release file

1.3.1

1 release file

1.3

1 release file

1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page