python-introspect
Extensible analysis of callable signatures, dataclass fields, type hints, and docstrings.
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.
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_introspect-0.1.8.tar.gz.
File metadata
- Download URL: python_introspect-0.1.8.tar.gz
- Upload date:
- Size: 36.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
966e7b8ac4efc0b39292b79d325d406d0ba2f1e104a7f22e6a78bee0fa3a7dcc
|
|
| MD5 |
c26f1704d12ea2dcd38bd523ee6f38da
|
|
| BLAKE2b-256 |
fcb28feb0e764ac37e532d5313db30abf8760feae2e129fc5a9f7dfcdf8db3ad
|
File details
Details for the file python_introspect-0.1.8-py3-none-any.whl.
File metadata
- Download URL: python_introspect-0.1.8-py3-none-any.whl
- Upload date:
- Size: 30.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4deced01667b954ef80fc6c89833c0dc1e01f46eafeb6976b6cd9931dc8b36f
|
|
| MD5 |
f4a3310ee369c4e2c605dea5edb1984c
|
|
| BLAKE2b-256 |
e5c852652322b87acc34e1479b3c33110b9ae94b4b5ea818ace7fdb6ca5fd503
|