Name | reacttrs JSON |
Version |
0.1.4
JSON |
| download |
home_page | None |
Summary | Attributes with superpowers |
upload_time | 2023-06-06 06:52:13 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
textual
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# reacttrs
Reactive attributes extracted out from [Textual](https://textual.textualize.io/guide/reactivity).
```py
from reacttrs import reactive
class Foo:
name = reactive("Paul")
age = reactive(33)
birth = reactive(1990)
def watch_name(self, old, new):
print(f"{old=}, {new=}")
def validate_name(self, name):
if name == "John":
print("Hey John!")
return name
def compute_age(self) -> int:
age = 2023 - self.birth
print(f"{age=}")
return age
foo = Foo()
foo.name = "John"
foo.name = "Steve"
foo.age
foo.birth = 1991
foo.age
```
Raw data
{
"_id": null,
"home_page": null,
"name": "reacttrs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "textual",
"author": null,
"author_email": "David Brochart <david.brochart@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/52/cd/46d60ce2895910062d24740f3c9c26c2b049db731c40e9993265172dfeed/reacttrs-0.1.4.tar.gz",
"platform": null,
"description": "# reacttrs\n\nReactive attributes extracted out from [Textual](https://textual.textualize.io/guide/reactivity).\n\n```py\nfrom reacttrs import reactive\n\n\nclass Foo:\n\n name = reactive(\"Paul\")\n age = reactive(33)\n birth = reactive(1990)\n\n def watch_name(self, old, new):\n print(f\"{old=}, {new=}\")\n\n def validate_name(self, name):\n if name == \"John\":\n print(\"Hey John!\")\n return name\n\n def compute_age(self) -> int:\n age = 2023 - self.birth\n print(f\"{age=}\")\n return age\n\nfoo = Foo()\nfoo.name = \"John\"\nfoo.name = \"Steve\"\n\nfoo.age\nfoo.birth = 1991\nfoo.age\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Attributes with superpowers",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/davidbrochart/reacttrs"
},
"split_keywords": [
"textual"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "586441cc7ee494a2f776f9ee62eeecdceb56e779cfab192edac5cd966cd331d4",
"md5": "424f523fef33593fd6bbf4a98abc44a3",
"sha256": "aaa6c517ed881df3182cf5bd016223337731551f31f8a3ba15355ca6137b1762"
},
"downloads": -1,
"filename": "reacttrs-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "424f523fef33593fd6bbf4a98abc44a3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5259,
"upload_time": "2023-06-06T06:52:14",
"upload_time_iso_8601": "2023-06-06T06:52:14.367890Z",
"url": "https://files.pythonhosted.org/packages/58/64/41cc7ee494a2f776f9ee62eeecdceb56e779cfab192edac5cd966cd331d4/reacttrs-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "52cd46d60ce2895910062d24740f3c9c26c2b049db731c40e9993265172dfeed",
"md5": "0eb4f1d527e9463c334e98c400c9c4c2",
"sha256": "811110153ec1523d878ad7344f362fc77f8fd3a971dbf31687159557de397385"
},
"downloads": -1,
"filename": "reacttrs-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "0eb4f1d527e9463c334e98c400c9c4c2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4173,
"upload_time": "2023-06-06T06:52:13",
"upload_time_iso_8601": "2023-06-06T06:52:13.149759Z",
"url": "https://files.pythonhosted.org/packages/52/cd/46d60ce2895910062d24740f3c9c26c2b049db731c40e9993265172dfeed/reacttrs-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-06 06:52:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "davidbrochart",
"github_project": "reacttrs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "reacttrs"
}