
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Reactive state management for Python.
Track changes, validate data, implement undo/redo, and build reactive UIs with ease.
📚 Full documentation: https://mrowrlib.github.io/observant.py
pip install observant
Observant.py provides a set of observable primitives:
Observable[T]
: Wraps a scalar value and notifies listeners on changeObservableList[T]
: Observable wrapper around a listObservableDict[K, V]
: Observable wrapper around a dictionaryObservableProxy[T]
: Wraps a dataclass or object and exposes its fields as observablesUndoableObservable[T]
: Adds undo/redo support to any observablefrom observant import Observable
count = Observable(0)
count.on_change(lambda v: print(f"Count is now {v}"))
count.set(1) # → Count is now 1
from observant import ObservableList
items = ObservableList(["a", "b"])
items.on_change(lambda change: print(f"List changed: {change.type.name}"))
items.append("c") # → List changed: ADD
from observant import ObservableDict
settings = ObservableDict({"theme": "dark"})
settings.on_change(lambda change: print(f"Settings changed: {change.key}"))
settings["theme"] = "light" # → Settings changed: theme
from observant import ObservableProxy
from dataclasses import dataclass
@dataclass
class User:
name: str
age: int
user = User(name="Ada", age=36)
proxy = ObservableProxy(user)
name = proxy.observable(str, "name")
name.on_change(lambda v: print(f"Name changed to {v}"))
name.set("Grace") # → Name changed to Grace
# Save changes back to the original object
proxy.save_to(user)
print(user.name) # → Grace
from observant import ObservableProxy
from dataclasses import dataclass
from typing import List
@dataclass
class TodoItem:
text: str
completed: bool
@dataclass
class TodoListModel:
items: List[TodoItem]
class TodoListViewModel:
def __init__(self, model: TodoListModel):
self.model = model
self.proxy = ObservableProxy(model)
# Get observable list of items
self.items = self.proxy.observable_list(TodoItem, "items")
# Register computed properties
self.proxy.register_computed(
"completed_count",
lambda: sum(1 for item in self.items if item.completed),
["items"]
)
def add_item(self, text: str):
self.items.append(TodoItem(text=text, completed=False))
def toggle_item(self, index: int):
item = self.items[index]
item_proxy = ObservableProxy(item)
completed_obs = item_proxy.observable(bool, "completed")
completed_obs.set(not completed_obs.get())
item_proxy.save_to(item)
def save(self):
self.proxy.save_to(self.model)
# Usage
model = TodoListModel(items=[])
view_model = TodoListViewModel(model)
# Listen for changes
view_model.proxy.computed(int, "completed_count").on_change(
lambda count: print(f"Completed: {count}")
)
# Add and toggle items
view_model.add_item("Learn Python")
view_model.add_item("Learn Observant.py")
view_model.toggle_item(0) # → Completed: 1
Check out the full documentation and examples at https://mrowrlib.github.io/observant.py
FAQs
Type-safe observables and proxies for building reactive Python applications.
We found that observant demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.