Skip to main content

A Python package to print the structure of complex, nested Python objects.

Project description

Structure Inspector

structure_inspector is a Python package that allows you to print the structure of complex, nested Python objects. It supports dictionaries, lists, tuples, sets, and more. You can also display lengths of lists and strings, handle circular references, and limit recursion depth.

Installation

Install the package using pip:

pip install structure_inspector

Usage

from structure_inspector import StructureInspector

nested_object = {
    "name": "Laura Dam",
    "details": {
        "age": 35,
        "children": [
            {"name": "Van Dam", "age": 10},
            {"name": "Zay Cola", "age": 5}
        ]
    },
}

inspector = StructureInspector(max_depth=3, show_lengths=True)
inspector.print_structure(nested_object)

Directory Structure

structure_inspector/
│
├── structure_inspector/
│   ├── __init__.py
│   ├── structure_inspector.py
│
├── README.md
├── LICENSE
├── setup.py

Final Thoughts:

This enhanced version of the program and package adds useful features like circular reference handling, depth limiting, and support for additional types. You should be able to install and use it with a simple pip install structure_inspector command.

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

structure_inspector-1.0.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

structure_inspector-1.0.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file structure_inspector-1.0.2.tar.gz.

File metadata

  • Download URL: structure_inspector-1.0.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for structure_inspector-1.0.2.tar.gz
Algorithm Hash digest
SHA256 af9037bb6f362a13268a66cba368f35eec4738ec077a72a028a915ca52608d7b
MD5 68bad9796057c625dc959ea353b6eadc
BLAKE2b-256 2dbc0d7d59525d0a42418a9ab3b0815e033ccb9de2fb6d419391ad51eb39a28c

See more details on using hashes here.

File details

Details for the file structure_inspector-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for structure_inspector-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 073d4301502128423d193a375bdcacd143a1e0d4b9e68bac5d82a7355c6dff9a
MD5 655d8b5a2ae75d318c2c061b9d90198c
BLAKE2b-256 3245c3497c4fcfaea6c60913afeb885bf2d9daece63b814351ebfb062ce61600

See more details on using hashes here.

Supported by

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