Skip to main content

A tool for recursively exploring arbitrary python objects.

Project description

pynaunt allows you to deeply explore and introspect arbitrary python objects.

As an example, we can explore the os module just a bit:

>>> from pynaut import Container
>>> import os
>>> obj = Container(os)
>>> len(obj.children)
220
>>> w = list(obj.grep_attr_names('wait'))
>>> len(w)
4
>>> [a.metadata.name for a in w]
['wait', 'wait4', 'wait3', 'waitpid']
>>> from types import ModuleType
>>> test = lambda c: isinstance(c.obj, (bool, list, ModuleType))
>>> foo = list(obj.get_attr_matches(test))
>>> len(foo)
20
>>> [a.metadata.name for a in foo]
['_copy_reg', 'UserDict', '_abcoll', 'sys', 'py3kwarning', 'meta_path',
 'path_hooks', 'argv', 'warnoptions', 'path', 'errno', 'path', '__self__',
 'genericpath', 'stat', 'os', 'warnings', 'filters', 'types', 'linecache']
>>>

Additionally, there is support for searching an entire object tree for a (name, attribute) pair that meets an arbitrary condition.

pynaut also includes a very basic curses based interface (pynaut_curses) that lets you explore objects by descending through the attribute tree.

Project details


Download files

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

Source Distribution

pynaut-0.2.7.zip (12.5 kB view details)

Uploaded Source

File details

Details for the file pynaut-0.2.7.zip.

File metadata

  • Download URL: pynaut-0.2.7.zip
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pynaut-0.2.7.zip
Algorithm Hash digest
SHA256 b299a7b7a58c46eecf0d29b0e25fabaa630c557d69000d0e7d1f174cb26a662f
MD5 1cc41a4fa6ff0b01ddf60785a6f096c6
BLAKE2b-256 1306eeadfd7e67d07c1a37d29b47955bfb3de031719961a2c67faae60b4e3415

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page