To get started with using barfi, you need to setup a virtual environment and install barfi using
Inside your virtual environment, install the package using:
pip install barfi
The fundamental part of barfi is a Block. A Block contains inputs, outputs and some computation. More details on what is a block and how to build one can be found here: Block. In the demo below, is an example of a block with one output (
feed) and another block with one input (
result). It is built using the
Block class provided in
To use barfi in a graphical environment, make use of the streamlit component Streamlit Widget that is built into
st_barfi and pass in the base blocks as an array to build the graphical editor.
To run the script, simply follow streamlit’s run command from the terminal.
streamlit run app.py.
from barfi import st_barfi, Block feed = Block(name='Feed') feed.add_output() result = Block(name='Result') result.add_output() st_barfi(base_blocks=[feed, result])
Run the file
app.py in command line using streamlit’s run command:
streamlit run app.py