Skip to main content

IPyhon magics for durable rules.

Project description

durable_rules_magic

Binder

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

durable_rules_tools-0.0.1.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

durable_rules_tools-0.0.1-py3-none-any.whl (5.1 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