Stateful variables in Python, a new way to calculate
Project description
Pyliven
Pronounced /ˈpaɪlʌɪvɛn/
Pyliven is an initiative to add stateful computation in the Python programming language. With this package, your python variables with automatically update if a dependency variable is updated. It's a new way to calculate in python.
Use
Pyliven can be leveraged in multiple ways. One use-case can be to write formulae in python. Let's try with the classic Electrostatic force formula:
from pyliven.liven import LiveNum
k = 9e9
q1 = LiveNum(2e-3)
q2 = LiveNum(3e-3)
r = LiveNum(1)
Force = k*q1*q2/r**2
Now we can directly update any of q1
, q2
, and r
, and the value of Force
will update.
r.update(5)
print(Force)
You can find the complete documentation at https://keymii.github.io/pyliven
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
pyliven-0.1.0.tar.gz
(8.3 kB
view hashes)