aesel package

Submodules

aesel.AeselEventClient module

The Main Client for generating Aesel Events

class aesel.AeselEventClient.AeselEventClient(host, port, encryption_key=None, encryption_iv=None)

Bases: object

Initializing the event client requires a UDP address to send events to, and may also take encryption information. This information is typically retrieved dynamically from Aesel Servers during Registration to a Scene.

Parameters:
  • host (str) – The host to send the message to.
  • port – The port to send the message to.
  • encryption_key (str) – AES-256-cbc encryption key to use for outgoing UDP messages.
  • encryption_iv (str) – AES-256-cbc encryption IV to use for outgoing UDP messages.
send_object_action_update(obj)

Send an outgoing Object Action Update message over UDP.

Parameters:obj – AeselObject to convert into an event.
Returns:None.
send_object_frame_update(obj)

Send an outgoing Object Frame Update message over UDP.

Parameters:obj – AeselObject to convert into an event.
Returns:None.
send_object_update(obj)

Send an outgoing Object Update message over UDP.

Parameters:obj – AeselObject to convert into an event.
Returns:None.
send_property_action_update(prop)

Send an outgoing Property Action Update message over UDP.

Parameters:prop – AeselProperty to convert into an event.
Returns:None.
send_property_frame_update(prop)

Send an outgoing Property Frame Update message over UDP.

Parameters:prop – AeselProperty to convert into an event.
Returns:None.
send_property_update(prop)

Send an outgoing Property Update message over UDP.

Parameters:prop – AeselProperty to convert into an event.
Returns:None.
update_endpoint(host, port, encryption_key=None, encryption_iv=None)

Update Client address & encryption credentials (key & salt).

Parameters:
  • host (str) – The host to send the message to.
  • port – The port to send the message to.
  • encryption_key (str) – AES-256-cbc encryption key to use for outgoing UDP messages.
  • encryption_iv (str) – AES-256-cbc encryption IV to use for outgoing UDP messages.
Returns:

None.

aesel.AeselTransactionClient module

The Main Client for accessing all HTTP Operations in the Aesel API.

class aesel.AeselTransactionClient.AeselTransactionClient(aesel_url)

Bases: object

Initializing the Transaction Client just requires the HTTP(s) address which it can use to communicate with the Aesel server.

Parameters:aesel_url (str) – The address of the Aesel servers.
activate_user(key)

Activate an existing User.

Parameters:key – The key of the user to update
add_favorite_project(key, project_key)

Add a Favorite Project to an existing user in the Aesel server.

Parameters:
  • key – The key of the user to update
  • project_key – The key of the project to add to the favorites list
add_favorite_scene(key, scene_key)

Add a Favorite Scene to an existing user in the Aesel server.

Parameters:
  • key – The key of the user to update
  • project_key – The key of the scene to add to the favorites list
add_scene_group(key, scene_group)

Add a scene group to an existing project in the Aesel server.

Parameters:
  • key (str) – The key of the AeselProject to be updated.
  • scene_group – AeselSceneGroup to add to the project.
add_scene_to_scene_group(key, group_name, scene_key)

Add a scene to a scene group in the Aesel server.

Parameters:
  • key (str) – The key of the AeselProject to be updated.
  • group_name (str) – The name of the scene group to update.
  • scene_key – The key of the AeselScene to add to the group.
asset_collection_query(collection, num_records=10, page=0)

Query Asset Collections from the Aesel server.

Parameters:
  • collection – The AeselAssetCollection to be used as a match query.
  • num_records – The maximum number of records to return in the query.
  • page – The page number of records to return, with num_records as the page size.
bulk_query_asset_metadata(keys)

Query Asset Metadata by ID in bulk, and return the json content of the response.

Parameters:keys – A list of Asset Keys to retrieve the metadata of.
Returns:JSON containing a list of Asset Metadata entries.
bulk_scene_query(scenes, num_records=10, start_record=0)

Query for scenes by attribute. Passing in multiple scenes will return the sum of the results of using each scene as a query.

Parameters:
  • scenes – A list of AeselScenes to use as a query.
  • num_records – How many records to retrieve.
  • start_record – The first record to retrieve. Works with num_records to support pagination.
Returns:

JSON with a list of found scenes.

create_asset(file, asset=None, relationship=None)

Create a New Asset in the Aesel Server.

Parameters:
  • file (str) – The path to the file to save as an Asset
  • asset – Optional AssetMetadata to associate with the Asset.
  • relationship – Optional AssetRelationship to associate with the Asset.
Returns:

The key of the newly created object.

create_asset_collection(collection)

Create a new Asset Collection in the Aesel server.

Parameters:collection – AeselAssetCollection to be created.
create_object(scene_key, obj)

Create a new Object.

Parameters:
  • scene_key (str) – The key of the AeselScene the object is associated to.
  • obj – The AeselObject to persist.
Returns:

JSON with a list of created objects, including the newly generated key.

create_object_action(scene_key, obj_key, action)

Create an Action against an existing Object.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselObject to add the action to.
  • action – The action to add to the Object
create_object_frame(scene_key, obj_key, action_name, frame)

Create an ObjectFrame against an existing Action.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselObject to add the frame to.
  • action_name (str) – The action to add the frame to.
  • frame – The AeselObjectFrame to add to the action.
create_project(project)

Create a new project in the Aesel server.

Parameters:project – AeselProject to be created.
create_property(scene_key, property)

Create a new Property.

Parameters:
  • scene_key (str) – The key of the AeselScene the object is associated to.
  • property – The AeselProperty to persist.
Returns:

JSON with a list of created properties, including the newly generated key.

create_property_action(scene_key, prop_key, action)

Create an Action against an existing property.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselProperty to add the action to.
  • action – The action to add to the property.
create_property_frame(scene_key, prop_key, action_name, frame)

Create a PropertyFrame against an existing Action.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • prop_key (str) – The key of the AeselProperty to add the frame to.
  • action_name (str) – The action to add the frame to.
  • frame – The AeselPropertyFrame to add to the action.
create_scene(key, scene)

Create a new Scene with the given key

Parameters:
  • key (str) – The key of the Scene to create
  • scene – The AeselScene to persist.
Returns:

JSON with a list of created scenes.

create_user(user)

Create a new user in the Aesel server. Note that this will only be processed successfully if the logged-in user calling it is an administrator.

Parameters:user – The user to create
deactivate_user(key)

Deactivate a User.

Parameters:key – The key of the user to update
delete_asset(key)

Delete an Asset by Key.

Parameters:key (str) – The key of the Asset to delete
delete_asset_collection(key)

Delete an Asset Collection from the Aesel server by key.

Parameters:key (str) – The key of the AeselAssetCollection to be deleted.
delete_asset_relationship(asset, type, related)

Delete an Asset Relationship

Parameters:
  • asset (str) – The Asset key in the relationship to delete.
  • type (str) – The type of the relationship to delete.
  • related (str) – The related entity key in the relationship to delete.
Returns:

JSON with deleted asset relationships.

delete_object(scene_key, obj_key)

Delete an Object by key.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselObject to get.
delete_object_action(scene_key, obj_key, action_name)

Delete an Action from an existing Object.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselObject to add the action to.
  • action_name (str) – The name of the action to delete from the Object.
delete_object_frame(scene_key, obj_key, action_name, frame_index)

Delete an ObjectFrame from an existing Action.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselObject to add the action to.
  • action_name (str) – The name of the action to remove the Frame from.
  • frame_index (str) – The index of the keyframe to delete.
delete_project(key)

Delete a project from the Aesel server by key.

Parameters:key (str) – The key of the AeselProject to be deleted.
delete_property(scene_key, property_key)

Delete an Property by key.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • property_key (str) – The key of the AeselProperty to get.
delete_property_action(scene_key, prop_key, action_name)

Delete an Action from an existing property.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselProperty to add the action to.
  • action_name (str) – The name of the action to delete from the property.
delete_property_frame(scene_key, prop_key, action_name, frame_index)

Delete a PropertyFrame from an existing Action.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • prop_key (str) – The key of the AeselProperty to add the action to.
  • action_name (str) – The name of the action to remove the Frame from.
  • frame_index (str) – The index of the keyframe to delete.
delete_scene(key)

Delete a Scene with the given key

Parameters:key (str) – The key of the Scene to delete
delete_scene_group(key, group_name)

Delete a Scene Group from a Project in the Aesel server.

Parameters:
  • key (str) – The key of the AeselProject to be updated.
  • group_name (str) – The name of the scene group to update.
delete_user(key)

Delete an existing User from Aesel by Key.

Parameters:key (str) – The username for the user
deregister(scene_key, device_key)

Deregister a device from a scene.

Parameters:
  • scene_key (str) – The key of the AeselScene to deregister from.
  • device (str) – The key of the AeselUserDevice which is deregistering.
Returns:

JSON with a list of updated scenes.

gen_asset_params(asset, relationship)
gen_base_url()
get_asset(key)

Get an Asset by Key, and return the content of the response.

Parameters:key (str) – The key of the Asset to retrieve
Returns:The content of the response, usually to be saved to a file.
get_asset_collection(key)

Get an Asset Collection from the Aesel server by key.

Parameters:key (str) – The key of the AeselAssetCollection to be retrieved.
get_asset_collections(keys)

Get an Asset Collection from the Aesel server by key.

Parameters:keys – A list of keys for the AeselAssetCollections to be retrieved.
get_asset_history(key)

Get an Asset History by Key, and return the json content of the response.

Parameters:key (str) – The key of the Asset to retrieve the history for
Returns:JSON containing an Asset History corresponding to the requested Asset.
get_object(scene_key, obj_key)

Get an Object by key.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselObject to get.
Returns:

JSON with a list of created objects, including the newly generated key.

get_project(key)

Get a project from the Aesel server by key.

Parameters:key (str) – The key of the AeselProject to be retrieved.
get_property(scene_key, property_key)

Get a Property by key.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • property_key (str) – The key of the AeselProperty to get.
Returns:

JSON with a list of created properties, including the newly generated key.

get_scene(key)

Get a Scene with the given key

Parameters:key (str) – The key of the Scene to update
Returns:JSON with a list of retrieved scenes.
get_user(key)

Get an existing User from Aesel by Key

Parameters:key (str) – The username for the user
lock_object(scene_key, obj_key, device_key)

Lock an Object by key.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselObject to lock.
  • device_key (str) – The key of the AeselUserDevice obtaining the lock.
login(username, password)

Login to the Aesel server, storing the Authentication header from the response as a bearer token for future requests.

Parameters:
  • username (str) – The username with which to login
  • password (str) – The password with which to login
make_user_admin(key)

Make a user an administrator.

Parameters:key – The key of the user to update
object_query(scene_key, object, num_records=999)

Query for objects by scene and attribute.

Parameters:
  • scene_key (str) – The key of the AeselScene to find objects in.
  • object – The AeselObject to use as a query.
  • num_records – How many records to retrieve.
Returns:

JSON with a list of found scenes.

project_query(project, num_records=10, page=0)

Query projects from the Aesel server.

Parameters:
  • project – The AeselProject to be used as a match query.
  • num_records – The maximum number of records to return in the query.
  • page – The page number of records to return, with num_records as the page size.
property_query(scene_key, property, num_records=999)

Query for properties by scene and attribute.

Parameters:
  • scene_key (str) – The key of the AeselScene to find objects in.
  • property – The AeselProperty to use as a query.
  • num_records – How many records to retrieve.
Returns:

JSON with a list of found scenes.

query_asset_metadata(asset)

Query Assets by Metadata, and return the json content of the response.

Parameters:asset – The AeselAssetMetadata which will be used as a match query.
Returns:JSON containing a list of Asset Metadata entries, including keys.
query_asset_relationships(query)

Query for asset relationships.

Parameters:query – The AeselAssetRelationship to use as a query.
Returns:JSON with a list of found asset relationships, including keys.
register(scene_key, device, transform=None)

Register a device to a scene. Potentially with a transformation.

Parameters:
  • scene_key (str) – The key of the AeselScene to register to.
  • device – The AeselUserDevice which is registering.
  • transform – The starting AeselSceneTransform to register.
Returns:

JSON with a list of updated scenes.

remove_admin_rights(key)

Remove admin priveleges from a User.

Parameters:key – The key of the user to update
remove_favorite_project(key, project_key)

Remove a Favorite Project from an existing user in the Aesel server.

Parameters:
  • key – The key of the user to update
  • project_key – The key of the project to remove from the favorites list
remove_favorite_scene(key, scene_key)

Remove a Favorite Scene from an existing user in the Aesel server.

Parameters:
  • key – The key of the user to update
  • scene_key – The key of the scene to remove from the favorites list
remove_scene_from_scene_group(key, group_name, scene_key)

Remove a scene from a scene group in the Aesel server.

Parameters:
  • key (str) – The key of the AeselProject to be updated.
  • group_name (str) – The name of the scene group to update.
  • scene_key – The key of the AeselScene to add to the group.
save_asset_relationship(new_relationship, existing_relationship=None)

Add an Asset Relationship between the specified asset and related element

Parameters:
  • new_relationship – The relationship to persist.
  • existing_relationship – If we are updating, then what do we need to query on to find the existing relationship.
Returns:

JSON containing the Relationship and ID.

scene_query(scene, num_records=10, start_record=0)

Query for scenes by attribute.

Parameters:
  • scene – An AeselScene to use as a query.
  • num_records – How many records to retrieve.
  • start_record – The first record to retrieve. Works with num_records to support pagination.
Returns:

JSON with a list of found scenes.

set_auth_info(auth_token)

Set the authentication token to be used on Requests

Parameters:auth_token (str) – The value of the auth token to use on requests

Set the cookies contained in the Transaction sessions.

Parameters:cookie – The text value of the desired Cookie header.
synchronize(scene_key, device_key, transform)

Correct the device transformation relative to the scene.

Parameters:
  • scene_key – The key of the AeselScene in the relationship.
  • device_key – The key of the AeselUserDevice which is registered.
  • transform – The updated transformation.
Returns:

JSON with a list of updated scenes.

unlock_object(scene_key, obj_key, device_key)

Unlock an Object by key.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselObject to unlock.
  • device_key (str) – The key of the AeselUserDevice obtaining the lock.
update_asset(key, file, asset=None, relationship=None)

Update an existing Asset in the Aesel Server.

Parameters:
  • file (str) – The path to the file to save as an Asset
  • asset – Optional AeselAssetMetadata to associate with the Asset.
  • relationship – Optional AeselAssetRelationship to associate with the Asset.
Returns:

The key of the newly created object.

update_asset_collection(key, collection)

Update an existing Asset Collection in the Aesel server.

Parameters:
  • key (str) – The key of the AeselAssetCollection to be updated.
  • collection – AeselAssetCollection to be updated.
update_object(scene_key, obj_key, obj)

Create a new Object.

Parameters:
  • scene_key (str) – The key of the AeselScene the object is associated to.
  • obj_key (str) – The key of the AeselObject to update.
  • obj – The AeselObject to persist.
Returns:

JSON with a list of created objects, including the newly generated key.

update_object_action(scene_key, obj_key, action)

Update an Action against an existing Object.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselObject to add the action to.
  • action – The action to update in the Object. The name of the action will be used to find the action to update.
update_object_frame(scene_key, obj_key, action_name, frame)

Update a Frame in an existing Action from an Object.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselObject to add the action to.
  • action_name (str) – The action to update inside the Object.
  • frame – The AeselObjectFrame to update in the action. The frame attribute from the ObjectFrame will be used to find the record to update.
update_project(key, project)

Update an existing project in the Aesel server.

Parameters:
  • key (str) – The key of the AeselProject to be updated.
  • project – AeselProject to be updated.
update_property(scene_key, property_key, property)

Create a new Property.

Parameters:
  • scene_key (str) – The key of the AeselScene the object is associated to.
  • property_key (str) – The key of the AeselProperty to update.
  • property – The AeselProperty to persist.
Returns:

JSON with a list of created properties, including the newly generated key.

update_property_action(scene_key, prop_key, action)

Create an Action against an existing Property.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • obj_key (str) – The key of the AeselProperty to add the action to.
  • action – The action to update in the property. The name of the action will be used to find the action to update.
update_property_frame(scene_key, prop_key, action_name, frame)

Update a Frame in an existing Action from a property.

Parameters:
  • scene_key (str) – The key of the AeselScene to find the object in.
  • prop_key (str) – The key of the AeselProperty to add the action to.
  • action_name (str) – The action to update inside the property.
  • frame – The AeselPropertyFrame to update in the action. The frame attribute from the PropertyFrame will be used to find the record to update.
update_scene(key, scene)

Update an existing Scene with the given key

Parameters:
  • key (str) – The key of the Scene to update
  • scene – The AeselScene to persist.
Returns:

JSON with a list of updated scenes.

update_scene_group(key, group_name, scene_group)

Update a scene group of an existing project in the Aesel server.

Parameters:
  • key (str) – The key of the AeselProject to be updated.
  • group_name (str) – The name of the scene group to update.
  • scene_group – AeselSceneGroup to add to the project.
update_user(key, user)

Update an existing user in the Aesel server.

Parameters:
  • key – The key of the user to update
  • user – The user to create
user_query(username='', email='')

Get an existing User from Aesel by Username or Email

Parameters:
  • username (str) – The username to search for
  • email (str) – The email to search for

Module contents