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

Uploaded Python 3

File details

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

File metadata

  • Download URL: structure_inspector-1.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 50eaeb1a94ae70a657cf51937b16188d114034e87468df69048a6f0892ff1eaa
MD5 c1ca57f049dde8fe1720934a1a47841a
BLAKE2b-256 4ec0e8002a9734784992ec2f53cf6bd5623910a9eb5d6523e464aa1e7441a9d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for structure_inspector-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7524a8a23ba20a55bb56f37018c73554209f2a7c7036199ec4626606524e0697
MD5 74cf81c30ea8bc646002879867a3c746
BLAKE2b-256 1dfc46a63927ac0a0cf3568fa7def4b57dde261af30f43afb46e9ebe8b9f7675

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