Skip to main content

Introspect any Python object

Project description

ObjSpct

objspct is a Python introspection tool that lets you explore any Python object. Whether you’re debugging, learning a library, or documenting your code, objspct gives you a rich, structured overview of an object’s attributes, methods, properties, and more — all in a beautifully formatted tree using Rich.

Features

Deep object introspection: Inspect types, classes, methods, properties, and attributes. Classify members intelligently: Automatically separates magic methods, internal/external methods, and attributes. Property-aware: Detects and lists properties separately. Pretty-print with Rich: Generates a tree view that’s easy to read and understand. Flexible filtering: Skip empty fields or select which categories to display.

Installation

pip install objspct

Usage

from objspct import inspect_object

class MyClass:
    def __init__(self):
        self.public_attr = 42
        self._internal_attr = "secret"

    @property
    def computed(self):
        return self.public_attr * 2

    def public_method(self):
        return "Hello"

    def _internal_method(self):
        return "Internal"

obj = MyClass()
inspect_object(obj)

This will output a rich, hierarchical tree showing all categorized members of the object.


Filtering

# Only display methods and properties
inspect_object(obj, categories=["methods_external", "properties"])

Skip Empty Attributes

# Skip empty attributes in the tree
inspect_object(obj, skip_empty=True)

Why Use objspct?

  • Learn unfamiliar objects and libraries quickly.
  • Debug complex classes or instances without manually exploring dir() or inspect.
  • Document object structures visually.
  • Perfect for teaching or self-learning Python OOP patterns.

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

objspct-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

objspct-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file objspct-0.1.0.tar.gz.

File metadata

  • Download URL: objspct-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for objspct-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd5b2a63023a8838bc5fd06f2fb17a51773638fc403c89be423228af34df061d
MD5 11422a5e9d6d1ef309cb7d01457d14d9
BLAKE2b-256 bf4f9c7c0ff156b5a03ef170228c643fa4d6876c213b8eb1f02886443c94d824

See more details on using hashes here.

File details

Details for the file objspct-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: objspct-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for objspct-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b5d52d66474e20b680f5ba50b4c89c3fa72ee65bb5a9888985f011da249d9f
MD5 09aac25203bebb5b2def3fb390663091
BLAKE2b-256 6a036fb30f7e537f91e3d2457092d43807f44d5ef171f30d682043b1c0849c24

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