IPyhon magics for durable rules.
Project description
durable_rules_magic
Magic to simplify working with durable.rules in educational contexts, initially when working with "subject, predicate, object" triple style reasoning.
Install as:
pip install --upgrade git+https://github.com/innovationOUtside/durable_rules_magic.git
See the demo.ipynb
for usage.
Additional Notes
If we define:
from IPython.display import Javascript
class Speech():
def say(self, txt):
display(Javascript(f'speechSynthesis.speak(new SpeechSynthesisUtterance("{txt}"))'))
then we can get Python to speak...
For example:
speaker = Speech()
speaker.say('hello')
This means we can hear the reasoning using rules of the form:
@when_all(Subject('eats', 'worms'))
def bird(c):
speaker.say(f'if {c.m.subject} eats worms')
Set(c, '? : is : bird')
speaker.say(f'{c.m.subject} is a bird')
which would make the rules both accessible and easier to follow.
Could we perhaps create a decorator to the rules that would provide such spoken annotations?
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
File details
Details for the file durable_rules_tools-0.0.1.tar.gz
.
File metadata
- Download URL: durable_rules_tools-0.0.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 318090346d568955f383634ab2dcc475ff67aa4e773c4ed400f9249facba4a63 |
|
MD5 | f00b87adbb78ae64040e8b012762d1e1 |
|
BLAKE2b-256 | c855dbb9f632dd505d3c6b9f269d025881f4950f107127af784040d689207d3d |
File details
Details for the file durable_rules_tools-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: durable_rules_tools-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a62f97c9d020f628bf5d6ff9a4d91f4bbb35c05d1b9401239020e627d0147144 |
|
MD5 | a6c354e86fc0d12b05e2b2be9873de4d |
|
BLAKE2b-256 | dc2219900efbae7c8e4bb9c9106e9a09cb698483483173f9e2ba2bf01e579660 |