Skip to main content

Clean Python introspection wrapper

Project description

PyIntrospect

PyIntrospect is a lightweight Python introspection wrapper that transforms raw runtime inspection into a clean, structured, human-readable analysis layer.

Built on top of Python’s inspect, it turns chaotic module metadata into organized intelligence.


Features

PyIntrospect extracts and organizes:

  • Submodules
  • Variables
  • Constants
  • Functions (with signatures + return type if available)
  • Classes (with inheritance + __init__ signature)
  • Module source code
  • Module file path
  • Summary metadata (counts + stats)

Installation

pip install pyintrospect

Quick Start

import pyintrospect
import os

r = pyintrospect.Reflect(os)
r.summary()

Core Concept

Python already provides dir() and inspect, but:

  • dir() → noisy, unstructured
  • inspect → powerful but low-level

PyIntrospect adds a semantic layer on top of inspect, making output structured, readable, and categorized.


API Reference

Reflect(module, HideDunder=True, pretty=True)

Parameter Description
module Python module to inspect
HideDunder If True, hides _private and __dunder__ members
pretty If True, prints formatted output instead of returning raw data

Methods

summary()

r.summary()

Returns:

  • module name
  • file path
  • version (if available)
  • counts of all member types
  • total members

submodules()

r.submodules()

variables()

r.variables()

constants()

r.constants()

functions()

r.functions()

classes()

r.classes()

source()

r.source()

path()

r.path()

all()

r.all()

CLI Usage

pyintrospect os
pyintrospect os --functions
pyintrospect requests --classes --raw

Options:

--dunder
--raw
--submodules
--variables
--constants
--functions
--classes
--source
--path
--all

Philosophy

Make Python introspection readable, structured, and meaningful.


Notes

  • Built-in modules may not expose source code
  • Some functions may not have signatures
  • Private members are filtered via HideDunder

License

MIT License
Copyright (c) 2026 Hoàng Long

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

pyintrospect-0.2.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

pyintrospect-0.2.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file pyintrospect-0.2.0.tar.gz.

File metadata

  • Download URL: pyintrospect-0.2.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pyintrospect-0.2.0.tar.gz
Algorithm Hash digest
SHA256 070903d5b46be4695cf0341e4e325d11739bdb4604bfe5e5f73f7fcba9e14743
MD5 3e0d5388811ecb8347721ce56c7c1f99
BLAKE2b-256 18470f6583471d6e2a8dd326895703dbf4fa761ec1393ac89223896ba03ba761

See more details on using hashes here.

File details

Details for the file pyintrospect-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyintrospect-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pyintrospect-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f222cdcc510e9d9d376e8391f320d76abd378522e12a7501a6547ac6e083c7f
MD5 8c4c75609c40303a19f0f047bfe54c1f
BLAKE2b-256 9644d2f59794c429b61759eb33e367e8cfb6e52dececd3036c9d6b0eb15619f2

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