Using the ByteBlower Python API
Posted by Vincent De Maertelaere, Last modified by Wouter Debie on 05 October 2018 11:02 AM
Since lots of our customers were asking for it. Here it is: our experimental Python API.|
The Python API allows users to script tests just like our TCL API does. Even more, the syntax is almost the same: Remove the dot from the TCL function names and you'll have the Python function! Isn't that easy?
It is not all puppies and sunshine. Because Python isn't TCL and the release is experimental, there are some warnings and caveats! Those warnings and caveats are listed later in this article.
InstallationAfter installing Python, you can download the Python API from here. After following the installation wizard, everything should be ready to go!
Basic usageAfter installation, you can open a terminal and import the ByteBlower package.
from byteblowerll.byteblower import ByteBlowerThis imports the ByteBlower module into the current Python space. Now we can connect to a server and create a port:
# Create a ByteBlower instance first. In TCL we should write [ ByteBlower Instance.Get ]
Python has a neat build-in help function. This works on all API objects. As of now returns a list of methods you can call on the object.
help(port)which gives following text.
Help on ByteBlowerPort in module byteblower object:The complete TCL documentation can be found on api.byteblower.com. Remove the dots (.) in the function names to get the Python name.
We are creating a library of examples that you can use as a reference for your own development. These examples can be found on our github account: https://github.com/excentis/ByteBlower_python_examples
Warnings and caveatsThe above Python API is a public beta version. It's fully functional and used both in- and outside Excentis. But a couple points are worth mentioning: