# py-signe
[中文文档](./README.cn.md)
#### Introduction
A responsive system implemented in python with reference to the core mechanisms of [S.js](https://github.com/adamhaile/S) and [vue reactivity](https://github.com/vuejs/core/tree/main/packages/reactivity).
#### Installation
```shell
pip install signe
```
#### 使用
```python
from signe import signal, effect, computed
num = signal(1)
@computed
def plus1():
return num.value + 1
@effect
def _():
print('plus1 is :',plus1.value)
# should print `plus1 is :2`
num.value=10
# should print `plus1 is :11`
```
- `signal` Creates a signal. Reads and writes via `.value`.
- `computed` Creates a computed expression. The argument is a function. When a signal (`signal.value`) is used in the function to get a value, this calculation expression is automatically associated with the signal. When the value of the signal changes, the computed expression is automatically triggered to change.
- `effect` is essentially the same as `computed`. A change in the signal or `computed` expression is automatically captured and triggered.
Raw data
{
"_id": null,
"home_page": "https://github.com/CrystalWindSnake/py-signe",
"name": "signe",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "python, reactivity, reactivity-system",
"author": "CrystalWindSnake",
"author_email": "568166495@qq.com",
"download_url": "https://files.pythonhosted.org/packages/1c/d4/79eaf8dca49c57b541915629d7ebfdfa2140d524871d962b497b98686d5b/signe-0.4.23.tar.gz",
"platform": null,
"description": "# py-signe\n\n[\u4e2d\u6587\u6587\u6863](./README.cn.md)\n\n\n#### Introduction\nA responsive system implemented in python with reference to the core mechanisms of [S.js](https://github.com/adamhaile/S) and [vue reactivity](https://github.com/vuejs/core/tree/main/packages/reactivity). \n\n\n#### Installation\n```shell\npip install signe\n```\n\n\n\n#### \u4f7f\u7528\n```python\nfrom signe import signal, effect, computed\n\nnum = signal(1)\n\n@computed\ndef plus1():\n return num.value + 1\n\n\n@effect\ndef _():\n print('plus1 is :',plus1.value)\n\n# should print `plus1 is :2`\n\nnum.value=10\n\n# should print `plus1 is :11`\n\n\n```\n\n- `signal` Creates a signal. Reads and writes via `.value`.\n- `computed` Creates a computed expression. The argument is a function. When a signal (`signal.value`) is used in the function to get a value, this calculation expression is automatically associated with the signal. When the value of the signal changes, the computed expression is automatically triggered to change.\n- `effect` is essentially the same as `computed`. A change in the signal or `computed` expression is automatically captured and triggered.",
"bugtrack_url": null,
"license": "MIT",
"summary": "A responsive system implemented in python with reference to the core mechanisms of S.js and vue reactivity.",
"version": "0.4.23",
"project_urls": {
"Homepage": "https://github.com/CrystalWindSnake/py-signe",
"Repository": "https://github.com/CrystalWindSnake/py-signe"
},
"split_keywords": [
"python",
" reactivity",
" reactivity-system"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5342d154fb9b92cf13b99511d710f31fa14f59522571601a3e0703f1c9b8dd67",
"md5": "c35c14b274ed32a548c9e2b67f23ea3f",
"sha256": "3c8c1681ff1535970410b022014957f3d4211f5666b90d1e3c0be6936bf3f8e0"
},
"downloads": -1,
"filename": "signe-0.4.23-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c35c14b274ed32a548c9e2b67f23ea3f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 20251,
"upload_time": "2024-12-21T14:02:54",
"upload_time_iso_8601": "2024-12-21T14:02:54.617924Z",
"url": "https://files.pythonhosted.org/packages/53/42/d154fb9b92cf13b99511d710f31fa14f59522571601a3e0703f1c9b8dd67/signe-0.4.23-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1cd479eaf8dca49c57b541915629d7ebfdfa2140d524871d962b497b98686d5b",
"md5": "faa2d485f1ade1db5e5b0311da98865f",
"sha256": "2b2fbda802eadef0ed02586237b0025b2190d8661beb1a0cf3853c78bf4fac31"
},
"downloads": -1,
"filename": "signe-0.4.23.tar.gz",
"has_sig": false,
"md5_digest": "faa2d485f1ade1db5e5b0311da98865f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 13820,
"upload_time": "2024-12-21T14:02:55",
"upload_time_iso_8601": "2024-12-21T14:02:55.948000Z",
"url": "https://files.pythonhosted.org/packages/1c/d4/79eaf8dca49c57b541915629d7ebfdfa2140d524871d962b497b98686d5b/signe-0.4.23.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-21 14:02:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CrystalWindSnake",
"github_project": "py-signe",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "signe"
}