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
Release history Release notifications | RSS feed
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.9.zip
(15.8 kB
view details)
File details
Details for the file pynaut-0.2.9.zip
.
File metadata
- Download URL: pynaut-0.2.9.zip
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ec451d9b2c79ab03e6ac2e7ebed5844d520aaebd38c6106a1474b2f755d039b |
|
MD5 | dab3e48df1b1f8422c2aab5bf7af6b60 |
|
BLAKE2b-256 | 8c308caf4dacebcf918670407adfc27293516b52da0edd1ec42573b97aae20f1 |