Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Guppy 3 -- Guppy-PE ported to Python 3

Project description

Guppy 3

Build Status Azure DevOps builds Codecov PyPI version
PyPI - Implementation PyPI - Python Version PyPI - Downloads PyPI - License

A Python Programming Environment & Heap analysis toolset.

This package contains the following subpackages:

  • etc - Support modules. Contains especially the Glue protocol module.
  • gsl - The Guppy Specification Language implementation. This can be used to create documents and tests from a common source.
  • heapy - The heap analysis toolset. It can be used to find information about the objects in the heap and display the information in various ways.
  • sets - Bitsets and 'nodesets' implemented in C.

Guppy 3 is a fork of Guppy-PE, created by Sverker Nilsson for Python 2.

Requirements

You should have Python 3.5, 3.6, or 3.7. This package is CPython only; PyPy and other Python implementations are not supported. Python 2 support can be obtained from guppy-pe by Sverker Nilsson, from which this package is forked.

To use the graphical browser, Tkinter is needed. To use the remote monitor, threading must be available.

Installation

Install with pip by:

pip install guppy3

Usage

The following example shows

  1. How to create the session context: h=hpy()
  2. How to show the reachable objects in the heap: h.heap()
  3. How to show the shortest paths from the root to the single largest object: h.heap().byid[0].sp
  4. How to create and show a set of objects: h.iso(1,[],{})
>>> from guppy import hpy; h=hpy()
>>> h.heap()
Partition of a set of 30976 objects. Total size = 3544220 bytes.
 Index  Count   %     Size   % Cumulative  % Kind (class / dict of class)
     0   8292  27   739022  21    739022  21 str
     1   7834  25   625624  18   1364646  39 tuple
     2   2079   7   300624   8   1665270  47 types.CodeType
     3    400   1   297088   8   1962358  55 type
     4   4168  13   279278   8   2241636  63 bytes
     5   1869   6   269136   8   2510772  71 function
     6    400   1   228464   6   2739236  77 dict of type
     7     79   0   139704   4   2878940  81 dict of module
     8   1061   3    93368   3   2972308  84 types.WrapperDescriptorType
     9    172   1    81712   2   3054020  86 dict (no owner)
<89 more rows. Type e.g. '_.more' to view.>
>>> h.heap().byid[0].sp
 0: h.Root.i0_modules['os'].__dict__
>>> h.iso(1,[],{})
Partition of a set of 3 objects. Total size = 348 bytes.
 Index  Count   %     Size   % Cumulative  % Kind (class / dict of class)
     0      1  33      248  71       248  71 dict (no owner)
     1      1  33       72  21       320  92 list
     2      1  33       28   8       348 100 int
>>>

People have written awesome posts on how to use this toolset, including:

Formal and API documentation are also available.

Contributing

Issues and pull requests are welcome. You may also ask for help on using this toolset; however, in such cases, we will only provide guidance, and not profile your code for you.

Please make sure to update tests as appropriate.

Testing

To test if the heapy build and installation was ok, you can do:

>>> from guppy import hpy
>>> hpy().test()
Testing sets
Test #0
Test #1
Test #2
...

There will be several more tests. Some tests may take a while.

License

Copyright (C) 2005-2013 Sverker Nilsson, S. Nilsson Computer System AB
Copyright (C) 2019 YiFei Zhu

The right is granted to copy, use, modify and redistribute this code according to the rules in what is commonly referred to as an MIT license.

*** USE AT YOUR OWN RISK AND BE AWARE THAT THIS IS AN EARLY RELEASE ***

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for guppy3, version 3.0.8
Filename, size File type Python version Upload date Hashes
Filename, size guppy3-3.0.8-cp35-cp35m-macosx_10_6_intel.whl (457.8 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp35-cp35m-manylinux1_i686.whl (592.1 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp35-cp35m-manylinux1_x86_64.whl (610.4 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp35-cp35m-win32.whl (335.0 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp35-cp35m-win_amd64.whl (350.8 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp36-cp36m-macosx_10_6_intel.whl (458.3 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp36-cp36m-manylinux1_i686.whl (593.0 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp36-cp36m-manylinux1_x86_64.whl (611.2 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp36-cp36m-win32.whl (337.7 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp36-cp36m-win_amd64.whl (353.0 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp37-cp37m-macosx_10_6_intel.whl (459.0 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp37-cp37m-manylinux1_i686.whl (595.8 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp37-cp37m-manylinux1_x86_64.whl (614.1 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp37-cp37m-win32.whl (337.9 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size guppy3-3.0.8-cp37-cp37m-win_amd64.whl (353.1 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size guppy3-3.0.8.tar.gz (329.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page