# signalLib
<div align="center"><img src="./signallib.png" width="100" /></div>
<div align="center">
<img alt="MIT Licensed" src="https://img.shields.io/badge/license-MIT-blue.svg">
<img alt="Version Badge" src="https://img.shields.io/badge/version-1..0.0-brightgreen.svg">
</div>
<br>
> **signalLib** is a small, simple library for intergrating reactivity concepts like signals and observables.
## Installation
```bash
pip install signallib
```
## Getting Started
### Making Values Reactive
```python
from signallib import signal
name = signal('oarabile')
# this method takes in a function and
# when the value is changed, it passes
# the new variable into that function.
name.subscribe(lambda x: print(x))
# this is both our setter and getter
name.value = 'averylongnamecausewhynot'
# the "name" is printed onto the console
```
### Observing Changes To A Dict
```python
from signallib import observe
user = { "name": "oarabile", "age": 19 }
user = observe(user)
user.observer(lambda prop, value: print('The Prop Is ${prop}, and Value Of ${value}'))
user.name = 'john'
# we can even add custom properties
user.location = 'botswana'
# this is printed to the console 👇
# The Prop Is name, and Value Of john
```
## Contributing
We welcome contributions to **rosana.ds**! To contribute:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Make changes and commit (`git commit -am 'Add new feature'`).
4. Push to your fork (`git push origin feature-branch`).
5. Open a Pull Request.
Feel free to suggest new features and improvements.
## License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "signallib",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "python, reactivity, signals, observers",
"author": "Oarabile Koore",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/51/8f/24f9694c3dbb2cef6c90b8338c2d5a1395f6f6d850f7a56b61e4da720a94/signallib-1.0.0.tar.gz",
"platform": null,
"description": "\r\n# signalLib\r\r\n\r\r\n<div align=\"center\"><img src=\"./signallib.png\" width=\"100\" /></div>\r\r\n\r\r\n<div align=\"center\">\r\r\n <img alt=\"MIT Licensed\" src=\"https://img.shields.io/badge/license-MIT-blue.svg\">\r\r\n <img alt=\"Version Badge\" src=\"https://img.shields.io/badge/version-1..0.0-brightgreen.svg\">\r\r\n</div>\r\r\n\r\r\n<br>\r\r\n\r\r\n> **signalLib** is a small, simple library for intergrating reactivity concepts like signals and observables.\r\r\n\r\r\n## Installation\r\r\n\r\r\n```bash\r\r\npip install signallib\r\r\n```\r\r\n\r\r\n## Getting Started\r\r\n\r\r\n### Making Values Reactive\r\r\n\r\r\n```python\r\r\nfrom signallib import signal\r\r\n\r\r\nname = signal('oarabile')\r\r\n\r\r\n# this method takes in a function and\r\r\n# when the value is changed, it passes\r\r\n# the new variable into that function.\r\r\nname.subscribe(lambda x: print(x))\r\r\n\r\r\n# this is both our setter and getter\r\r\nname.value = 'averylongnamecausewhynot'\r\r\n\r\r\n# the \"name\" is printed onto the console\r\r\n```\r\r\n\r\r\n### Observing Changes To A Dict\r\r\n\r\r\n```python\r\r\nfrom signallib import observe\r\r\n\r\r\nuser = { \"name\": \"oarabile\", \"age\": 19 }\r\r\n\r\r\nuser = observe(user)\r\r\n\r\r\nuser.observer(lambda prop, value: print('The Prop Is ${prop}, and Value Of ${value}'))\r\r\n\r\r\nuser.name = 'john'\r\r\n\r\r\n# we can even add custom properties\r\r\nuser.location = 'botswana'\r\r\n\r\r\n# this is printed to the console \ud83d\udc47\r\r\n# The Prop Is name, and Value Of john\r\r\n```\r\r\n\r\r\n## Contributing\r\r\n\r\r\nWe welcome contributions to **rosana.ds**! To contribute:\r\r\n\r\r\n1. Fork the repository.\r\r\n2. Create a new branch (`git checkout -b feature-branch`).\r\r\n3. Make changes and commit (`git commit -am 'Add new feature'`).\r\r\n4. Push to your fork (`git push origin feature-branch`).\r\r\n5. Open a Pull Request.\r\r\n\r\r\nFeel free to suggest new features and improvements.\r\r\n\r\r\n## License\r\r\n\r\r\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.\r\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python library for signals and observers",
"version": "1.0.0",
"project_urls": null,
"split_keywords": [
"python",
" reactivity",
" signals",
" observers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f2ca6fc68de56ceafbb3384df7c709e0f3a599f9df92a3e48e06175a39c7f146",
"md5": "2ffe229da60bb0b166755e78e4aa1a47",
"sha256": "f02c78113cda819d34e0c8a86973fcbc7f99e9bc043168f25f98b617c3e55856"
},
"downloads": -1,
"filename": "signallib-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2ffe229da60bb0b166755e78e4aa1a47",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 2805,
"upload_time": "2024-12-26T23:56:50",
"upload_time_iso_8601": "2024-12-26T23:56:50.901410Z",
"url": "https://files.pythonhosted.org/packages/f2/ca/6fc68de56ceafbb3384df7c709e0f3a599f9df92a3e48e06175a39c7f146/signallib-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "518f24f9694c3dbb2cef6c90b8338c2d5a1395f6f6d850f7a56b61e4da720a94",
"md5": "d050574655580eff8ab5cdd38eead569",
"sha256": "590fcceffdc90ae578132a0735e4247d02feeb22e84d2c78caff7c19d271d86b"
},
"downloads": -1,
"filename": "signallib-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "d050574655580eff8ab5cdd38eead569",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2930,
"upload_time": "2024-12-26T23:56:52",
"upload_time_iso_8601": "2024-12-26T23:56:52.360528Z",
"url": "https://files.pythonhosted.org/packages/51/8f/24f9694c3dbb2cef6c90b8338c2d5a1395f6f6d850f7a56b61e4da720a94/signallib-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-26 23:56:52",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "signallib"
}