Skip to main content

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


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)

Uploaded Source

Built Distribution

pyliven-0.1.0-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page