Inspect Recursive
Inspect Recursive is a Python package that provides functionality for inspecting the structure of Python objects recursively.
Features
- Inspect the structure of Python objects, including nested dictionaries, lists, and other iterable objects.
- Print the structure of objects as a tree, displaying their types and contents.
- Handle specific types like NumPy arrays and pandas DataFrames, if installed.
Installation
You can install Inspect Recursive using pip:
pip install inspect-recursive
Usage
inspect_object_structure
- Example 1: Inspecting a simple dictionary
import inspect_recursive as ipr
simple_dict = {"a": 1, "b": 2, "c": 3}
ipr.what(simple_dict)
<<<<<<<<<<<<<<<<<<<<inspector<<<<<<<<<<<<<<<<<<<<<
- object : <class 'dict'>
>len=3 content-type=<class 'str'> vals="['a', 'b', 'c']"
- idx0 : <class 'str'>
>val="'a'"
- idx1 : <class 'str'>
>val="'b'"
> > > > > > > > > > > > > > > > > > > > > > > > >
- Example 2: Inspecting a nested dictionary
import inspect_recursive as ipr
nested_dict = {"a": {"x": 1, "y": 2}, "b": {"z": 3}}
what(nested_dict)
<<<<<<<<<<<<<<<<<<<<inspector<<<<<<<<<<<<<<<<<<<<<
- object : <class 'dict'>
>len=2 content-type=<class 'str'> vals="['a', 'b']"
- idx0 : <class 'str'>
>val="'a'"
- idx1 : <class 'str'>
>val="'b'"
> > > > > > > > > > > > > > > > > > > > > > > > >
- Example 3: Inspecting a list of strings
list_of_strings = ["apple", "banana", "cherry"]
what(list_of_strings)
<<<<<<<<<<<<<<<<<<<<inspector<<<<<<<<<<<<<<<<<<<<<
- object : <class 'list'>
>len=3 content-type=<class 'str'> vals="['apple', 'banana', 'cherry']"
- idx0 : <class 'str'>
>val="'apple'"
- idx1 : <class 'str'>
>val="'banana'"
> > > > > > > > > > > > > > > > > > > > > > > > >
- Example 4: Inspecting a more complex object
import open3d as o3d
open3d_mesh = o3d.io.read_point_cloud(ply_filepath)
what(open3d_mesh, max_depth=6, thresh_iter_list=5, thresh_iter_dict=5)
<<<<<<<<<<<<<<<<<<<<inspector<<<<<<<<<<<<<<<<<<<<<
- object : <class 'open3d.geometry.PointCloud'>
>len=1000 content-type=<class 'open3d.utility.Vector3dVector'>
- idx0 : <class 'open3d.utility.Vector3d'>
>val="Vector3d(0.002537, -0.01984, -0.08411)"
- idx1 : <class 'open3d.utility.Vector3d'>
>val="Vector3d(-0.02286, -0.04225, -0.07801)"
- idx2 : <class 'open3d.utility.Vector3d'>
>val="Vector3d(-0.03108, -0.04534, -0.0755)"
...
>len=3 content-type=<class 'numpy.ndarray'> ...
>len=2 content-type=<class 'dict'> ...
...
> > > > > > > > > > > > > > > > > > > > > > > > >
Contributing
Contributions are welcome! Please feel free to open issues or submit pull requests on GitHub.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for inspect-recursive 0.1.0
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 | Actions |
|---|---|---|---|---|
| inspect_recursive-0.1.0.tar.gz | 4.5 kB | Without provenance | Details for inspect_recursive-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| inspect_recursive-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for inspect_recursive-0.1.0-py3-none-any.whl |
Total release size: 10.0 kB
Release files / inspect_recursive-0.1.0.tar.gz
| Download URL | inspect_recursive-0.1.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51ebe574b4f5360a2fbf70aa58709d898896735636d83a3efe5b3f017b658b45
|
|
BLAKE2b-256 checksum How to use checksums |
333273de295ece015e39ee591f613c4575e87def8026bfbaea750c4f29621742
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.4 Linux/6.5.0-25-generic
|
Release files / inspect_recursive-0.1.0-py3-none-any.whl
| Download URL | inspect_recursive-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
328660138acdd1823a9cd64e79f5147c5611864490877592fc1b6061cbc19eb0
|
|
BLAKE2b-256 checksum How to use checksums |
cb516f3c95f8c5b3552bf6d21535765cc59cacb6aef939afcd5661536315a7a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.4 Linux/6.5.0-25-generic
|
Security for inspect-recursive 0.1.0
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.