fastreactpy ⚡
Fast, lightweight reactive state library for Python.
fastreactpy brings React-like reactive state to Python with zero dependencies, minimal overhead, and a clean API.
🚀 Installation
pip install fastreactpy
🧠 Core Concepts
Signal
A signal is a reactive container for state.
from fastreactpy import signal
count = signal(0)
count()→ get valuecount(10)→ set value and notify subscribers
Effect
An effect automatically re-runs when the signals it uses change.
from fastreactpy import effect
@effect
def logger():
print("Count:", count())
✨ Basic Example
from fastreactpy import signal, effect
count = signal(0)
@effect
def print_count():
print("Count changed:", count())
count(5)
count(10)
Output:
Count changed: 0
Count changed: 5
Count changed: 10
📁 Sharing State Between Multiple Files
This is the most common real-world usage.
store.py (Shared State)
from fastreactpy import signal
count = signal(0)
user = signal("Guest")
logger.py (Reactions / Effects)
from fastreactpy import effect
from store import count, user
@effect
def log_count():
print("[logger] Count:", count())
@effect
def log_user():
print("[logger] User:", user())
main.py (Mutating State)
import logger # IMPORTANT: registers effects
from store import count, user
count(1)
user("Malahim")
count(5)
user("Alice")
Output:
[logger] Count: 0
[logger] User: Guest
[logger] Count: 1
[logger] User: Malahim
[logger] Count: 5
[logger] User: Alice
🧩 Multiple Effects on One Signal
from fastreactpy import effect
from store import count
@effect
def double():
print("Double:", count() * 2)
@effect
def square():
print("Square:", count() ** 2)
⚡ Why fastreactpy?
- Zero dependencies
- Extremely lightweight
- React-style mental model
- Automatic dependency tracking
- Works across files
- Ideal for CLIs, tools, and services
⚠️ Best Practices
- Keep shared signals in a single module (e.g.
store.py) - Always import modules that define effects
- Avoid heavy logic inside effects
- Use effects for side-effects only
🌐 Contact
Website: https://malahim.dev
Phone: +92 328 4671797
📄 License
MIT License © 2025 Malahim Haseeb
Metadata
Release files for fastreactpy 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fastreactpy-0.0.3.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastreactpy-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.5 kB
Release files / fastreactpy-0.0.3.tar.gz
| Download URL | fastreactpy-0.0.3.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5594f61154716073d601ca839723faf0597043ef3032855cbf99fcae5d9bfb6b
|
|
BLAKE2b-256 checksum How to use checksums |
dca7a2f1212a7dc17ab79cba8a3f0ff5917d9b2ba976ff6c5ca5fe0304a81517
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / fastreactpy-0.0.3-py3-none-any.whl
| Download URL | fastreactpy-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
769f7e20d34e3532f72e9e5e32f4005e1cd06096e7953f9bc18863b19cc5bdf4
|
|
BLAKE2b-256 checksum How to use checksums |
99b9c66ccbb6a3f69ba614853d81900bdc97f0230b4ef80dcc9f73adc50c958c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|