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-1.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-1.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: objspct-1.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-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d0b95a8f12fa1d9c033031eb19f3159de05e096a9ba1c4651a86c27702a23748
MD5 5b09ad94231f912f24e9bdd044bb3700
BLAKE2b-256 139909afe04b30eae935688727daff6b24d28776984ff2e9a3daaef0c949bf31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: objspct-1.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-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5cd01cdd5f02ed72a78967ff46b9050a02e7b2da9fe162b1451222b110360f00
MD5 558f06fdfb04a10bee3c6f538826bfe4
BLAKE2b-256 047f6340594b90fa108f88c1a16db2abbf61eca672025f2fb67319fbf347f4b8

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