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.3.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.3-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: structure_inspector-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 7a7c0bcfceca1cc3ac9f52c05e9c1c5f50bb3213ffac19ba512ee62554e545f1
MD5 e40fa8cc6c3071d5afe634ed636ab40c
BLAKE2b-256 e61bd8bb6a06e66840d753cfb0efa1d1eca6f7dd15a32b3d9139f43f2ac6401a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for structure_inspector-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2561b456257ca67cf6c208e46e83c3396e24e31caed97b9eb5025782415c964b
MD5 bbc39b015142f3107aacff421ad236e6
BLAKE2b-256 b0cb00d46f1be7417972e3e8dc3bd072c79f55026e1c48ddbc55dc7a81a87d69

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