Introduction to Barfi
Barfi is an innovative library designed for Python users who wish to integrate Flow Based Programming (FBP) into their existing workflow. It offers a unique graphical programming interface, which simplifies the process of designing complex software applications by visually organizing the flow of data and operations.
Key Features
Barfi operates using what is referred to as barfi.Blocks
and a barfi.ComputeEngine
. The barfi.Blocks
serve as the building units for creating your application's schema. Each Block is equipped with input and output interfaces allowing them to connect with other Blocks. This connection enables the flow of data and the execution of user-defined functions within the Block.
Here's how it works: A user defines a function for a Block, which accesses data from the input interface, performs necessary computations or operations, and then sends the results to the output interface. This modular approach allows a seamless flow of operations much like a traditional flowchart, but with the added functionality of executing real Python code.
Integration and Customization
One of the standout attributes of Barfi is its integration capability. Unlike many existing visual Flow Based Programming libraries that operate in isolation, Barfi seamlessly integrates into Python workflows. This means it can function as a part of your existing Python scripts rather than being a separate environment. Currently, Barfi is accessible as a component within Streamlit, a popular app framework for Python data apps. Looking into the future, there are plans to include a Jupyter-Notebook widget to widen its usability.
Barfi is designed to be simple and customizable. It recognizes that users might have specific needs or follow different programming philosophies, which is why it provides the flexibility to adapt to different use-cases.
Addressing Limitations
The current visual programming libraries for Python have some shortfalls, particularly their inability to be part of existing workflows and the absence of domain-specific components. Barfi aims to overcome these obstacles. By integrating as a Streamlit widget and planning its adaptation for Jupyter-Notebooks, it positions itself as a practical tool for Python developers looking for visual programming solutions.
Looking forward, the roadmap for Barfi includes the development of domain-specific components, making it a more powerful and adaptable tool for users in specialized fields.
Getting Started
For those interested in starting with Barfi, installing it is straightforward. Within your Python project's virtual environment, you can install Barfi using pip with the following command:
pip install barfi
With the installation complete, users can start leveraging the graphical interface provided by Barfi through its Streamlit component, accessible with the API barfi.st_barfi
.
Technical Details
On the technical front, Barfi's frontend is developed using the Vue framework and BaklavaJS—a popular library for creating visual programming interfaces. This combination allows for a smooth and responsive experience when building and executing workflows in Barfi.
In conclusion, Barfi represents a significant step forward for developers looking to incorporate visual programming into their Python applications. Its integration capabilities, ease of use, and planned future enhancements make it a valuable tool in the modern software development landscape.