Skip to main content

Simple Python introspection tool

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.1.tar.gz (8.6 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.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyintrospect-0.2.1.tar.gz
  • Upload date:
  • Size: 8.6 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.1.tar.gz
Algorithm Hash digest
SHA256 3e35242493f46c925ffc23f1167a3fb4a6053fee06b6c829677014a98419fd48
MD5 a434abdd2b1f13f69c03a737263ec5eb
BLAKE2b-256 67bb04d3ff784126867d6ecbce71e355986575cbec8b603d5b1c528ea553c326

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyintrospect-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 82c7d624b4a53616cc88f26a582e2b0631f44a0220f5dedbdeb5739436e7cf23
MD5 e521d8100aa03363c0066f8286e077ce
BLAKE2b-256 6cc9533dc4389659a2774dd5e7bcbfee395f2a9ad210d2e90df845ecada3268c

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