Pretty inspect
Inspired by the complexity of Neo.
When browsing/inspecting an object, you want to collect all methods and attributes that match the key.
Example
Browsing the documentation of neo.io.BlackrockIO and looking for the ways of extracting Epochs, you found read_epoch() method. But calling this method raises AssertionError. You need to go deeper.
- Run
pip install pinspect neo - Download BlackRock sampledata.zip
wget http://www.blackrockmicro.com/wp-content/software/sampledata.zip
unzip sampledata.zip
- In python,
from neo.io import BlackrockIO
from pinspect import find
session = BlackrockIO('sampleData')
graph = find(session, 'epoch', verbose=True)
Output:
BlackrockIO.rescale_epoch_duration() -> 'TypeError'
BlackrockIO.read_epoch() -> 'AssertionError'
BlackrockIO._rescale_epoch_duration() -> 'TypeError'
BlackrockIO.read()[0].segments[0].epochs -> 'list of size 0'
BlackrockIO.read()[0].segments[0].events[0].to_epoch() -> 'Epoch'
The last two lines are candidates to explore manually.
Graph visualization
You can pass visualize=True and enjoy the beautiful networkx with pyvis interacting graph rendering.
Hover over the nodes (objects) and edges (methods and attributes) to explore the graph in details and inspect how a particular object has been generated.
Unfiltered graph
Below is the full unfiltered graph of neo.BlackRockIO of all possible method and attribute calls. Can you find the green dot?
Requirements
- Python 3.6+
- requirements.txt
Alternative
Another package to inspect python variables is objbrowser.
Metadata
Release files for pinspect 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pinspect-0.0.2.tar.gz | 8.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pinspect-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.9 kB
Release files / pinspect-0.0.2.tar.gz
| Download URL | pinspect-0.0.2.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d96c3a95e17122d43f3a183f43200673e64a8c4e35562c4b40ad5433daad9000
|
|
BLAKE2b-256 checksum How to use checksums |
5d3252d267a38c92771f27406d6f5080837844fbb7cddacfc28a61360edb7f48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5
|
Release files / pinspect-0.0.2-py3-none-any.whl
| Download URL | pinspect-0.0.2-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e485ed244cb11b29b01832dc5c180916c720b17c3ad3472f2a822fa11bdc903
|
|
BLAKE2b-256 checksum How to use checksums |
cf5a0fa37c325b5dcd760c4d37ab3fe5e36e42a5a442231d033241b623c3bebf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5
|
Security for pinspect 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.