Cameras API

Helios Cameras API.

Methods are meant to represent the core functionality in the developer documentation. Some may have additional functionality for convenience.

class helios.cameras_api.Cameras(session=None)[source]

The Cameras API provides access to all cameras in the Helios Network.

images(camera_id, start_time, end_time=None, limit=500)[source]

Get the image times available for a given camera in the media cache.

The media cache contains all recent images archived by Helios, either for internal analytics or for end user recording purposes.

Parameters:
  • camera_id (str) – Camera ID.
  • start_time (str) – Starting image timestamp, specified in UTC as an ISO 8601 string (e.g. 2014-08-01 or 2014-08-01T12:34:56.000Z).
  • end_time (str, optional) – Ending image timestamp, specified in UTC as an ISO 8601 string (e.g. 2014-08-01 or 2014-08-01T12:34:56.000Z).
  • limit (int, optional) – Number of images to be returned, up to a max of 500. Defaults to 500.
Returns:

Image times.

Return type:

list of strs

index(**kwargs)[source]

Get cameras matching the provided spatial, text, or metadata filters.

The maximum skip value is 4000. If this is reached, truncated results will be returned. You will need to refine your query to avoid this.

Parameters:**kwargs – Any keyword arguments found in the cameras_index_documentation.
Returns:
A tuple containing:
feature_collection (CamerasFeatureCollection):
Cameras feature collection.
failed (list of Record):
Failed API call records.
Return type:tuple
show(camera_ids)[source]

Get attributes for cameras.

Parameters:camera_ids (str or list of strs) – Helios camera ID(s).
Returns:
A tuple containing:
feature_collection (CamerasFeatureCollection):
Cameras feature collection.
failed (list of Record):
Failed API call records.
Return type:tuple
show_image(times, camera_id, out_dir=None, return_image_data=False)[source]

Get images from the media cache.

The media cache contains all recent images archived by Helios, either for internal analytics or for end user recording purposes.

Parameters:
  • times (str or list of strs) – Image times, specified in UTC as an ISO 8601 string (e.g. 2017-08-01 or 2017-08-01T12:34:56.000Z). The image with the closest matching timestamp will be returned.
  • camera_id (str) – Camera ID.
  • out_dir (optional, str) – Directory to write images to. Defaults to None.
  • return_image_data (optional, bool) – If True images will be available as PIL images in the returned ImageRecords. Defaults to False.
Returns:

A tuple containing:
images (list of ImageRecord):

All received images.

failed (list of :ImageRecord):

Failed API calls.

Return type:

tuple

class helios.cameras_api.CamerasFeature(feature)[source]

Individual Camera GeoJSON feature.

city

‘city’ value for the feature.

Type:str
country

‘country’ value for the feature.

Type:str
description

‘description’ value for the feature.

Type:str
direction

‘direction’ value for the feature.

Type:str
id

‘id’ value for the feature.

Type:str
json

Raw ‘json’ for the feature.

Type:dict
region

‘region’ value for the feature.

Type:str
state

‘state’ value for the feature.

Type:str
video

‘video’ value for the feature.

Type:bool
class helios.cameras_api.CamerasFeatureCollection(features)[source]

Collection of GeoJSON features obtained via the Cameras API.

Convenience properties are available to extract values from every feature.

features

All features returned from a query.

Type:list of CamerasFeature
city

‘city’ values for every feature.

coordinates

‘coordinate’ values for every feature.

country

‘country’ values for every feature.

description

‘description’ values for every feature.

direction

‘direction’ values for every feature.

id

‘id’ values for every feature.

json

Raw ‘json’ for every feature.

region

‘region’ values for every feature.

state

‘state’ values for every feature.