The Python Scripting package is a Bonsai interface for the Python programming language. It uses Python.NET under the hood to provide a seamless integration between the CPython runtime and data streaming in a Bonsai workflow.
You can use the Python Scripting package to run native Python scripts, import any module available to Python, and read or write to any variable in a named scope. The package is designed to work with any Python version from 3.7 onwards, and you can also use it in combination with Python virtual environments to fully isolate your project dependencies.
Conceptual and reference documentation for this package can be found here.
Development of this package was supported by funding from the Allen Institute for Neural Dynamics and from the Biotechnology and Biological Sciences Research Council [grant number BB/W019132/1].