Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

2.0 KB
Raw Blame

Counter

This is an example of a simple state machine.

We have three files:

  • application.py -- This contains a mainline to run the counter as well as a function to export the counter (for later use)
  • requirements.txt -- Just the requirements. All this needs is Burr/Streamlit
  • streamlit_app.py -- This contains a simple Streamlit app to interact with the counter.
  • notebook.ipynb -- A notebook that shows the counter app too. Open the notebook Open In Colab

To run just the application, you can run:

python application.py

To run the streamlit app, you can run:

streamlit run streamlit_app.py

This will open a chrome window and print out the URL. The state machine this encapsulates takes the following form:

State Machine

Note: if you are looking for an example of the class based action API, then take a look at application_classbased.py.