A Python library for signals and observers
Project description
signalLib
<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">
signalLib is a small, simple library for intergrating reactivity concepts like signals and observables.
Installation
pip install signallib
Getting Started
Making Values Reactive
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
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:
-
Fork the repository.
-
Create a new branch (
git checkout -b feature-branch). -
Make changes and commit (
git commit -am 'Add new feature'). -
Push to your fork (
git push origin feature-branch). -
Open a Pull Request.
Feel free to suggest new features and improvements.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file signallib-1.0.0.tar.gz.
File metadata
- Download URL: signallib-1.0.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
590fcceffdc90ae578132a0735e4247d02feeb22e84d2c78caff7c19d271d86b
|
|
| MD5 |
d050574655580eff8ab5cdd38eead569
|
|
| BLAKE2b-256 |
518f24f9694c3dbb2cef6c90b8338c2d5a1395f6f6d850f7a56b61e4da720a94
|
File details
Details for the file signallib-1.0.0-py3-none-any.whl.
File metadata
- Download URL: signallib-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f02c78113cda819d34e0c8a86973fcbc7f99e9bc043168f25f98b617c3e55856
|
|
| MD5 |
2ffe229da60bb0b166755e78e4aa1a47
|
|
| BLAKE2b-256 |
f2ca6fc68de56ceafbb3384df7c709e0f3a599f9df92a3e48e06175a39c7f146
|