Install Smappi Client for Python to usePublished at: April 4, 2018, 3:33 p.m. in the Documentation
To make it easier to work with the Smappi API and Python, smappi-py was implemented.
With this client, you can call any API as function calls.
Python version 2.7 and higher, including version 3, is supported.
Simple installation from PyPI:
pip install smappi
Or you can download the repository and install it manually:
git clone firstname.lastname@example.org:smappi/smappi-py.git cd smappi-py python setup.py install
Let's analyze a couple of examples
All is simple enough, you need to pass to the smappi function the path to the API and call the required method:
from smappi import smappi # smappi('<username>/<api>').<func>(**kwargs) smappi('adw0rd/example').greeting(name='friend') "Hello, friend!"
Or here is another example, with a demonstration of format API and option as list:
import smappi smappi.Request('adw0rd/example', 'json').calculator(digits=[42, 42, 42]) 126 smappi.Request('adw0rd/example', 'json').calculator(digits='42,42,42') 126
Smappi as much as possible tries to be intuitively understandable to usage!