Runtime Reflection Lite
Lightweight runtime reflection for Python — with proper type awareness.
🚀 Why this exists
Python has powerful introspection capabilities, but working with them in practice can be messy:
- Type hints are not always resolved
- Metadata is scattered across different APIs
- Understanding structure at runtime requires a lot of boilerplate
This library provides a clean and consistent abstraction layer for inspecting Python code at runtime.
👉 The goal is simple: Make runtime structure easy to access, understand, and use
✨ Features
- 🔍 Inspect modules, classes, and functions
- 🧠 Resolve type hints (including forward references)
- 🔐 Understand encapsulation and structure
- ⚡ Lightweight implementation (no source code parsing)
- 🧩 Clean API for building higher-level tooling
📦 Use cases
This library is especially useful when building:
- Frameworks
- Dependency injection systems
- Code analysis tools
- Runtime validation systems
- Developer tooling
👉 If you're working with dynamic architectures, this removes a lot of friction.
🏗 Design philosophy
Unlike heavier reflection systems, this project deliberately avoids:
- ❌ Parsing source code
- ❌ Full AST inspection
This keeps it:
✅ Fast ✅ Predictable ✅ Easy to integrate
⚙️ Example
from runtime.reflection.lite import MemberFilter, MemberInfo, Class, Method, reflect, get_signature, get_members
class Class1:
def __init__(self, value: str):
self.__value = value
def do_something(self, suffix: str | None = None) -> str:
return self.__value + (suffix or "")
reflection: Class = reflect(Class1)
reflection.constructor.signature # -> (value: str)
member_info, method = reflection.members.subset_methods()["do_something"] # -> tuple[MemberInfo, Method]
signature1 = get_signature(Class1.do_something) # -> (suffix: str | None) -> str
signature2 = get_signature(Class1.__init__) # -> (value: str)
members = get_members(Class1, filter = MemberFilter.FUNCTIONS_AND_METHODS)
member_info, member = members["do_something"] # -> MemberInfo, Member
Full documentation
Metadata
Release files for runtime-reflection-lite 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| runtime_reflection_lite-0.2.2.tar.gz | 27.2 kB | With provenance | Details for runtime_reflection_lite-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| runtime_reflection_lite-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for runtime_reflection_lite-0.2.2-py3-none-any.whl |
Total release size: 58.4 kB
Release files / runtime_reflection_lite-0.2.2.tar.gz
| Download URL | runtime_reflection_lite-0.2.2.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bef4914e201d63a00f946cb3cea99459eafb1f0fd3fbc66409446da78eb1f0a
|
|
BLAKE2b-256 checksum How to use checksums |
0373be5d2d51a36517e103cf15345b67d1c74d8d2f2a435c315068974a94ce51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / runtime_reflection_lite-0.2.2-py3-none-any.whl
| Download URL | runtime_reflection_lite-0.2.2-py3-none-any.whl |
|---|---|
| Size | 31.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7dc11ebe7c30fb06ff9f19d222096fb7f2d5eab365129d9b076e7f1022640628
|
|
BLAKE2b-256 checksum How to use checksums |
7abaa90690d252664546d3bf698409e28d6e7d48de0e5b4c8961b3107ca8bf5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for runtime-reflection-lite 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for runtime_reflection_lite-0.2.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.