reacttrs
Reactive attributes, initially extracted out from Textual, now a fork of Declare.
from reacttrs import Int, Str
class Foo:
name = Str("Paul")
age = Int(34)
birth = Int(1990)
@name.watch
def _watch_name(self, old: str, new: str):
print(f"{old=}, {new=}")
@age.validate
def _validate_age(self, value: int) -> int:
return 2024 - self.birth
foo = Foo()
foo.name = "John" # old='Paul', new='John'
foo.name = "Steve" # old='John', new='Steve'
print(foo.age) # 34
foo.birth = 1991
foo.age = 34
print(foo.age) # 33
Metadata
Release files for reacttrs 0.2.1
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 |
|---|---|---|---|---|
| reacttrs-0.2.1.tar.gz | 3.5 kB | Without provenance | Details for reacttrs-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reacttrs-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for reacttrs-0.2.1-py3-none-any.whl |
Total release size: 7.9 kB
Release files / reacttrs-0.2.1.tar.gz
| Download URL | reacttrs-0.2.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a2cbf7a209deb0be056cc30e7c7c5f1ff5a744cba18c427d5418cc32bb1e53c
|
|
BLAKE2b-256 checksum How to use checksums |
909033daccaa6587d18e60ccc48a70d3c36e9e2b48db2606f7829b6c687b31fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Release files / reacttrs-0.2.1-py3-none-any.whl
| Download URL | reacttrs-0.2.1-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1425357d8d7b0d8bc89fc1dce2544410296b605429571e11b682492a3060caed
|
|
BLAKE2b-256 checksum How to use checksums |
450b888bee634da04d8fd8a7d177d48bca3888388145b8445810550e77de8b34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Security for reacttrs 0.2.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.