Add your description here
Project description
Why?
My (author) motivation is to be able to generally describe systems that respond to change.
Related (but not the same):
- reactive programming libraries: Doesn't focus on a 'state'
- dynamical systems pathsim: This library doesn't, at the face of it, look like it can do what pathsim does, but I think sim descriptions could be mapped somehow.
How?
Rules/functions are repeatedly applied to a 'state' (dict) until there are no more changes.
import state_rules.main as rm
r = rm.Rules({'x':1})
#
@r.register({'return': 'x', 'x': 'x' })
def f1(x):
return x+x
r.run(5)
r.log
[
Iteration(i=0, state={'x': 1})
Iteration(i=1, state={'x': 2})
Iteration(i=2, state={'x': 4})
Iteration(i=3, state={'x': 8})
Iteration(i=4, state={'x': 16})
Iteration(i=5, state={'x': 32})
]
Tips
- The state is a (flat) dictionary but you can use a fancy dotted dict if you want more structure.
Then, use use a function to get at a key.
In the example above:
x -> lambda k: k=='x' or k.endswith('.x') - Cache function calls (yourself)
- Define your notion of dictionary equality
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
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 state_rules-2026.3.33.tar.gz.
File metadata
- Download URL: state_rules-2026.3.33.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dede8ac6af07f003bfb3cb48c089045af6103b2fb2b6e2c2e7200479e9048772
|
|
| MD5 |
9d52a86c0d0387d2d4c6444d7840ccb3
|
|
| BLAKE2b-256 |
84057dd19e21a3e91b7a00afe78f3da2f48f9748a56aef8c003b0fdb24be9589
|
Provenance
The following attestation bundles were made for state_rules-2026.3.33.tar.gz:
Publisher:
python-publish.yaml on majidaldo/state-rules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
state_rules-2026.3.33.tar.gz -
Subject digest:
dede8ac6af07f003bfb3cb48c089045af6103b2fb2b6e2c2e7200479e9048772 - Sigstore transparency entry: 1107900154
- Sigstore integration time:
-
Permalink:
majidaldo/state-rules@6890d70f6585c44f8b8ea916eb0ceb8249f3ba5b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/majidaldo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yaml@6890d70f6585c44f8b8ea916eb0ceb8249f3ba5b -
Trigger Event:
push
-
Statement type:
File details
Details for the file state_rules-2026.3.33-py3-none-any.whl.
File metadata
- Download URL: state_rules-2026.3.33-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c832a76396f4e9e0c27287d17ae1eb3a34b99d8844b0a2a556c3695f7c253d3
|
|
| MD5 |
9a8c7397d124a883da70977fd8b71bf7
|
|
| BLAKE2b-256 |
161d603b16a1df6cd8085731669b8404dfb470d0375de9b7d7d600cfa38ee861
|
Provenance
The following attestation bundles were made for state_rules-2026.3.33-py3-none-any.whl:
Publisher:
python-publish.yaml on majidaldo/state-rules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
state_rules-2026.3.33-py3-none-any.whl -
Subject digest:
3c832a76396f4e9e0c27287d17ae1eb3a34b99d8844b0a2a556c3695f7c253d3 - Sigstore transparency entry: 1107900157
- Sigstore integration time:
-
Permalink:
majidaldo/state-rules@6890d70f6585c44f8b8ea916eb0ceb8249f3ba5b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/majidaldo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yaml@6890d70f6585c44f8b8ea916eb0ceb8249f3ba5b -
Trigger Event:
push
-
Statement type: