Metadata-Version: 2.4
Name: pytrace-inject
Version: 0.1.2
Summary: Runtime AOP injection for Python — intercept and modify local variables at any execution point
Project-URL: Homepage, https://github.com/YuYi-09/pytrace-inject
Project-URL: Repository, https://github.com/YuYi-09/pytrace-inject
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# pytrace-inject: Runtime AOP injection for Python.

A lightweight framework that lets you intercept and modify local variables
at any execution point of a target function, using `sys.settrace`.

## Quick Start
```python
import random
from pytrace_inject import At, inject, start_trace, end_trace

@inject(At(random.randrange).atcall())
def modify(start, end):
    start, end = 42, 43
    return {'start': start, 'end': end}

start_trace()
print(random.randrange(100, 999))  # Output: 42
end_trace()
```

## Key Concepts
- **At** — Where to inject (call time / return time / specific line / custom condition).
- **Tracer** — The active injection, can be `.remove()`'d at any time.
- **Callback** — Your function that receives current local variables
  and returns a `dict` of replacements (or `None`).

## License
MIT — see [LICENSE](LICENSE) file.
