Documentation Status
Travis-CI Build Status
Requirements Status
license PyPI Package latest release PyPI Wheel
Supported versions Supported implementations
Commits since latest release

Zentropi: Script Your World.

Zentropi is for you if:

  • You like the idea of making your own bots.
  • You want to build your personal internet-of-things.
  • You are curious about automation at work and/or home.
  • You care about your time; automation lets you do more of things you enjoy.
  • You consider building your own tools to tackle the increasing complexity of your responsibilities.
  • You imagine a world where your real and virtual worlds can interact with each other seamlessly.
  • You dream of raising your own army of minions... doing your work tirelessly while you take a vaca...

..where were we? Ah, yes, if any of these ^^ sound familiar, you are not alone!


Note: Requires Python 3.5+ and compiler toolchain to build c-extensions.


$ python3 -m venv zen
$ source zen/bin/activate
$ pip install zentropi


$ python3 -m venv zen
$ source zen/bin/activate
$ git clone https://github.com/zentropi/python-zentropi.git
$ cd python-zentropi
$ pip install -e .

Install steps for Ubuntu and MacOS: https://zentropi.readthedocs.io/en/latest/installation.html


We will make a toy agent that responds to the message “hello” with a “hello, world”.


The above illustration shows how the concepts and objects are logically arranged and connected within Zentropi. We will go deeper into these in the READMEs along with examples, for now let us jump straight to the code:

from zentropi import Agent, on_message, run_agents, ZentropiShell

class HelloBot(Agent):
    def say_hello(self, message):
        return 'hello, world'

if __name__ == '__main__':
    hello_bot = HelloBot(name='hello_bot')
    shell = ZentropiShell(name='shell')
    run_agents(hello_bot, shell)

Save this as hello.py and run with $ python hello.py

You should see this on your screen:

$ python hello.py
⚡ ︎ @shell: '*** started'
⚡ ︎ @shell: 'shell-starting'
⚡ ︎ @shell: 'shell-ready'

We can type any message at the prompt and the shell agent will broadcast it for us. Go ahead and type hello, followed by ENTER.

✉  @shell: 'hello'
✉  @hello_bot: 'hello, world' {'text': 'hello, world'}
⚡ ︎ @shell: 'shell-ready'

Type exit or press Ctrl-D to leave the shell.

What next?

Zentropi is still being developed and is not production-ready, however it is already useful to experiment and build toys.

Check out what is already possible in the examples directory: