A client utility for the AICA API
Project description
Python AICA API Client
The AICA API client module provides simple functions for interacting with the AICA API.
pip install aica-api
The client can be used to easily make API calls as shown below:
from aica_api.client import AICA
aica = AICA()
aica.set_application('my_application.yaml')
aica.start_application()
aica.load_component('my_component')
aica.unload_component('my_component')
aica.stop_application()
To check the status of component predicates and conditions, the following blocking methods can be employed:
from aica_api.client import AICA
aica = AICA()
if aica.wait_for_condition('timer_1_active', timeout=10.0):
print('Condition is true!')
else:
print('Timed out before condition was true')
if aica.wait_for_predicate('timer_1', 'is_timed_out', timeout=10.0):
print('Predicate is true!')
else:
print('Timed out before predicate was true')
Compatability table
The latest version of the AICA API client will generally support the latest API server version in the AICA framework. Major changes to the API client or server versions indicate breaking changes and are not backwards compatible. To interact with older versions of the AICA framework, it may be necessary to install older versions of the client. Use the following compatability table to determine which client version to use.
API server version | Matching Python client version |
---|---|
3.x |
>= 2.0.0 |
2.x |
1.2.0 |
<= 1.x |
Unsupported |
Between major version changes, minor updates to the API server version and Python client versions may introduce new endpoints and functions respectively. If a function requires a feature that the detected API server version does not yet support (as is the case when the Python client version is more up-to-date than the targeted API server), then calling that function will return None with a warning.
Recent client versions also support the following functions to check the client version and API compatability.
from aica_api.client import AICA
aica = AICA()
# get the current API server version
print(aica.api_version())
# get the current client version
print(aica.client_version())
# check compatability between the client version and API version
if aica.check():
print('Versions are compatible')
else:
print('Versions are incompatible')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aica_api-2.1.0.tar.gz
.
File metadata
- Download URL: aica_api-2.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2569ff084bfcec94e58dde464ba91e5259489f15de8761e7bc8572a4a05a5f8f |
|
MD5 | f964a1eb6786c9c163c4f0296c500f6b |
|
BLAKE2b-256 | 1a35d3ba252f6aca843e990e782066272a1300ec20a6f89615fc5a6c54a21769 |
File details
Details for the file aica_api-2.1.0-py3-none-any.whl
.
File metadata
- Download URL: aica_api-2.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0eaade90bb7bd4df0a5884bdc9aafe8db7edd2df4a09158d40bf2a9db126b6ed |
|
MD5 | 62ece45d086acfdbe56b89caa66fac25 |
|
BLAKE2b-256 | 9ef008706f6cdb01c4f42baf8be6267de4c384e6d01b2cf72c97b3133cd003d8 |