When a page is started, REST API endpoints are exposed under /api.

This API may be used to update a page from an external script.

See awe.api_client.APIClient source for details on specific endpoints. The code is short and pretty self explanatory.

Python Client

class awe.api_client.APIClient(host='', port=8080)[source]

REST API client.

Can be used to update a running page from an external script.

  • hostawe server host.
  • portawe server port.

Verify liveness of awe’s server.

get_elements(include_data=False, include_props=False)[source]

Get all elements currently registered.

  • include_data – Should element data be included in the response.
  • include_props – Should element props be included in the response.

Get a single registered element.

Parameters:element_id – The element id.
new_element(obj, params=None, element_id=None, root_id=None, parent_id=None, new_root=False)[source]

Create a new element. Equivalent to calling the new() method on elements.

  • obj – The obj argument as expected by the new() method.
  • params – Params to pass on to the new() method invocation.
  • element_id – Optionally specify an element_id. (one will be generated otherwise)
  • root_id – Optionally specify a different root to create the element under. If not specified, and parent_id is not supplied, the main page root will be used.
  • parent_id – Optionally specify the element to call the new() method on.
  • new_root – Pass True to create the element under a new root.

Remove an element from the page.

Parameters:element_id – The element id.
new_prop(element_id, name)[source]

Create a new prop child. Equivalent to calling new_prop() on an element.

  • element_id – The element id to call new_prop on.
  • name – The prop name.
update_data(element_id, data)[source]

Update the element data. Equivalent to calling update_data() on an element.

  • element_id – The element id to call update_data on.
  • data – The data to set on the element.
update_props(element_id, props)[source]

Update the element props. Equivalent to calling update_props() on an element.

  • element_id – The element id to call update_props on.
  • props – The props to set on the element.
update_prop(element_id, path, value)[source]

Update an element prop. Equivalent to calling update_prop() on an element.

  • element_id – The element id to call update_prop on.
  • path – The prop path.
  • value – The prop value.
call_method(element_id, method_name, kwargs=None)[source]

Call a method on an element. Useful when working with elements such as a table or a chart that expose methods to modify their internal state.

  • element_id – The element id to call the specified method on.
  • method_name – The method to call.
  • kwargs – Keyword arguments to pass to the method invocation.

Get all variables currently registered.


Get a single registered variable.

Parameters:variable_id – The variable id.
new_variable(value, variable_id=None)[source]

Create a new variable.

  • value – The variable’s initial value.
  • variable_id – Optionally, supply a variable id, one will be generated otherwise.
update_variable(variable_id, value)[source]

Update a variable.

  • variable_id – The variable id.
  • value – The new variable value.
call_function(function_id, kwargs=None)[source]

Call a registered function.

  • function_id – The function id.
  • kwargs – Additional keyword arguments to pass to the function invocation.