Skip to main content

python-introspect

Extensible analysis of callable signatures, dataclass fields, type hints, and docstrings, plus signature-derived callable declaration projection.

Python 3.10+ PyPI version

Quick start

from python_introspect import SignatureAnalyzer

def resize(image, factor: float = 0.5, *, preserve_range: bool = True):
    """Resize an image.

    Args:
        image: Input image.
        factor: Scale factor.
        preserve_range: Preserve the input intensity range.
    """

parameters = SignatureAnalyzer().analyze(resize)

for name, info in parameters.items():
    print(name, info.param_type, info.default_value, info.is_required)

analyze is the unified entry point for functions, methods, classes, dataclass types, and instances. It returns a mapping of names to ParameterInfo records.

Use callable_declaration_kwargs when declaration identity should omit keyword arguments equal to their signature defaults. The caller supplies value equality so array, lazy, or other framework-specific values keep their owning semantics.

Extension points

Use register_namespace_provider to contribute names used while resolving forward references and register_type_resolver to unwrap application proxy types. Wrappers can declare their user-facing inspection target through the signature-target helpers in python_introspect.signature_analyzer.

Installation

python -m pip install python-introspect

The runtime depends on metaclass-registry. Repository and issues: OpenHCSDev/python-introspect.

Documentation

The maintained sources are in docs/source. Documentation changes are checked by the repository's documentation workflow; the local warnings-as-errors build command is documented in development.rst.

Metadata

Release files for python-introspect 0.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-introspect 0.1.14
File Size Uploaded
python_introspect-0.1.14.tar.gz 43.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-introspect 0.1.14
File Interpreter ABI Platform
python_introspect-0.1.14-py3-none-any.whl Python 3 none any Details

Total release size: 79.0 kB

Release files / python_introspect-0.1.14.tar.gz

Download URL python_introspect-0.1.14.tar.gz
Size 43.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4217e5124de78421f06458638466eadd8dc10aa12a8c0858961eaaf261976222
BLAKE2b-256 checksum
How to use checksums
cfb49f71fe146d75165450e13e8a86f0935597bc73ce82bf3c1ec1cf383cc96f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / python_introspect-0.1.14-py3-none-any.whl

Download URL python_introspect-0.1.14-py3-none-any.whl
Size 35.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54c548c67befffbd72e26d7b0ec420db661ba1a5a6096b6873dc37cfa1c21635
BLAKE2b-256 checksum
How to use checksums
563729a6358f29415fd8fa20c5cfa09693a3cb6b143a9636e2ed89dc6c1df1a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

0.1.14 This release

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page