API Reference

This section covers interfaces of Alteia Python SDK.

Main interface

Entry point

Alteia Python SDK has a unique entry point: The class SDK.

class SDK(*, config_path=None, user=None, password=None, client_id=None, client_secret=None, url=None, proxy_url=None, force_prompt=False, service=None, **kwargs)

Entry point providing access to resource managers.

Resource managers are availables as instance attributes. The dir builtin can be used to list the availables managers.

The following examples show various ways to instantiate that class:

  • Using a username and a password:

    >>> sdk = SDK(user='admin1', password='password')
    
  • Using an OAuth client identifier and secret:

    >>> sdk = SDK(client_id='72a5f676-6efc-48c5-ac07-4c534c3cdccc',
    ...           client_secret='52ccd77d-17e4-499b-995e-3a2731550723')
    
  • Using a configuration file:

    >>> sdk = SDK(config_path='~/.local/share/alteia/conf.json')
    
__init__(*, config_path=None, user=None, password=None, client_id=None, client_secret=None, url=None, proxy_url=None, force_prompt=False, service=None, **kwargs)

Initializes Alteia Python SDK entry point.

Parameters
  • config_path (Optional[str]) – Optional path to a custom configuration file.

  • user (Optional[str]) – Optional username (email).

  • password (Optional[str]) – Optional password (mandatory if username is defined).

  • client_id (Optional[str]) – Optional OAuth client identifier.

  • client_secret (Optional[str]) – Optional OAuth client secret (mandatory if client_id is defined).

  • url (Optional[str]) – Optional platform URL (default https://app.alteia.com).

  • proxy_url (Optional[str]) – Optional proxy URL.

  • force_prompt (bool) – Option to force the user to set or confirm his connection info through the prompt.

  • service (Union[str, List[str], None]) – Optional service name, to add in UserAgent in requests’ headers.

  • kwargs – Optional keyword arguments to merge with the configuration.

Configuration

class ConnectionConfig(file_path=None, *, user=None, password=None, client_id=None, client_secret=None, url=None, domain=None, proxy_url=None, access_token=None, **kwargs)

Connection configuration.

__init__(file_path=None, *, user=None, password=None, client_id=None, client_secret=None, url=None, domain=None, proxy_url=None, access_token=None, **kwargs)

Initializes a connection configuration.

Parameters
  • file_path (Optional[str]) – Optional path to a custom configuration file.

  • user (Optional[str]) – Optional username (email).

  • password (Optional[str]) – Optional password (mandatory if username is defined).

  • client_id (Optional[str]) – Optional OAuth client identifier.

  • client_secret (Optional[str]) – Optional OAuth client secret (mandatory if client_id is defined).

  • url (Optional[str]) – Optional platform URL (default https://app.alteia.com).

  • domain (Optional[str]) – Optional domain.

  • proxy_url (Optional[str]) – Optional proxy URL.

  • access_token (Optional[str]) – Optional access token.

  • kwargs

    Optional keyword arguments to merge with

    the configuration.

    kwargs : Optional arguments.

Three sources of configuration are merged:

  • The optional arguments kwargs.

  • The file at path file_path.

  • The default configuration.

The configuration file is expected to be written in JSON.

Resources management

class Resource(*, id=None, _Resource__remove_undefined=False, **kwargs)
__init__(*, id=None, _Resource__remove_undefined=False, **kwargs)

Resource class.

Parameters
  • id (Optional[str]) – Resource identifier (if missing, _id must be defined).

  • __remove_undefined – Optional option to remove undefined properties before storing it in the Resource (default is False).

  • **kwargs – Keyword arguments to initialize the resource properties.

Returns

Resource created.

Return type

Resource

Errors

Package errors.

exception BoundingBoxError(msg='')
exception ConfigError(msg='')
exception DownloadError(msg='')
exception FileError(msg='')
exception ImmutableAttribute(name)
exception MissingCredentialsError(msg='')
exception ParameterError(msg='')
exception QueryError(msg='')
exception ResponseError(msg, status=0)
exception SearchError(msg='')
exception TokenRenewalError(msg='')
exception UnsupportedOperationError
exception UnsupportedResourceError(resource_name)
exception UploadError(msg='')

Analytics

class AnalyticsImpl(analytics_service_api, **kwargs)
create(*, name, version, docker_image, company, display_name=None, description=None, instance_type=None, volume_size=None, inputs=None, parameters=None, deliverables=None, outputs=None, tags=None, groups=None, **kwargs)

Create an analytic.

Parameters
  • name (str) – Analytic name (must be unique with the version).

  • version (str) – Analytic version in semver format (must be unique with the name)

  • docker_image (str) – Docker image used for the analytic computation, including the Docker registry address. (example: "gcr.io/myproject/myanalytic:v1.0").

  • company (str) – Id of the company owning the analytic.

  • display_name (Optional[str]) – Optional user-friendly name of the analytic.

  • description (Optional[str]) – Optional analytic description.

  • instance_type (Optional[str]) – Optional instance type on which the analytic will be run (example: "small").

  • volume_size (Optional[int]) – Optional size of the attached volume (in gigabytes).

  • inputs (Optional[List[dict]]) – Optional inputs of the analytic.

  • parameters (Optional[List[dict]]) – Optional parameters of the analytic.

  • deliverables (Optional[List[dict]]) – Optional deliverables of the analytic.

  • outputs (Optional[List[dict]]) – Optional outputs of the analytic.

  • tags (Optional[List[str]]) – Optional tags of the analytic.

  • groups (Optional[List[str]]) – Optional groups of the analytic (used by the analytic catalogue on the front-end to group analytics).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Resource

Returns

The created analytic description.

Raises

KeyError – When a passed value is not supported.

Examples

>>> sdk.analytics.create(name="my_vehicle_detection",
...     version="0.0.1",
...     display_name="Vehicle detection",
...     description="Detects vehicles in orthomosaic images",
...     docker_image="gcr.io/myproject/vehicule-detection:v1.0",
...     company="5d3714e14c50356e2abd1f97",
...     instance_type='large',
...     volume_size=50,
...     inputs=[{
...         "name": "ortho",
...         "display_name": "Orthomosaic",
...         "description": "Orthomosaic",
...         "scheme": {
...             "type": "string", "pattern": "^[0-9a-f]{24}$"
...         },
...         "source": {
...             "service": "data-manager", "resource": "dataset",
...             "scheme": {
...                 "type": "object",
...                 "properties": {"type": {"const": "raster"}},
...                 "required": ["type"]
...             },
...         },
...         "required": True
...     }],
...     parameters=[{
...         "name": "project",
...         "display_name": "Project",
...         "description": "Project identifier",
...         "required": True,
...         "scheme": {
...             "type": "string", "pattern": "^[0-9a-f]{24}$"
...         }
...      }],
...     deliverables=[{
...         "name": "positions",
...         "display_name": "Vehicule positions",
...         "description": "Position of the vehicules in a CSV",
...         "scheme": {
...             "type": "string", "pattern": "^[0-9a-f]{24}$"
...         },
...         "source": {
...             "service": "data-manager", "resource": "dataset",
...             "scheme": {
...                 "type": "object",
...                 "properties": {"type": {"const": "file"}},
...                 "required": ["type"]
...             },
...         },
...         "required": True
...     }],
...      tags=["vehicle_detection"],
...      groups=["GeoInt"])
Resource(_id='60c331fed5ffbd0012f1fb1c')
delete(analytic, **kwargs)

Delete an analytic or a list of analytics permanently.

Parameters
  • analytic (Union[str, List[str]]) – Analytic identifier (or list of identifiers) to delete.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

None

describe(analytic, **kwargs)

Describe an analytic.

Parameters
  • analytic (str) – Identifier of the analytic to describe.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Resource

Returns

The analytic description.

describe_by_name(name, *, version=None)

Describe an analytic by name.

When the optional version argument is None, the analytic with highest version is returned.

When the optional version argument is not None, the analytic with that version is returned. If no such analytic exist, None is returned.

When version is a version range, the analytic with highest version within the specified range is returned.

Note that version is expected to follow the syntax defined by npm.

Parameters
  • analytic – Identifier or name of the analytic to describe.

  • version (Optional[str]) – Optional version or version range used to select the analytic to describe.

Examples

>>> sdk.analytics.describe_by_name('photogrammetry',
...     version='1.0.x')
Resource(_id='60c331fed5ffbd0012f1fb1a')
Return type

Optional[Resource]

disable(analytics, companies, **kwargs)

Make the given analytics not orderable by the given companies.

Parameters
  • analytics (Union[str, List[str]]) – Name of the analytic to disable, or list of such names.

  • companies (Union[str, List[str]]) – Identifier of the company you want to disable the analytics, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Examples

>>> # disable analytics "helloworld" from the company 406e0dcc965a0f56891f3862
>>> sdk.analytics.disable('helloworld', '406e0dcc965a0f56891f3862')
>>> # disable both analytics "helloworld" and "helloworld2"
>>> sdk.analytics.disable(['helloworld', 'helloworld2'], '406e0dcc965a0f56891f3862')
>>> # disable both analytics "helloworld" and "helloworld2" from many companies
>>> sdk.analytics.disable(['helloworld', 'helloworld2'],
...                       ['406e0dcc965a0f56891f3863', '406e0dcc965a0f56891f3862'])
Return type

Dict

enable(analytics, companies, **kwargs)

Make the given analytics orderable by the given comanies, provided they are already exposed on the domains of those companies.

Parameters
  • analytics (Union[str, List[str]]) – Name of the analytic to enable, or list of such names.

  • companies (Union[str, List[str]]) – Identifier of the company you want to expose the analytics, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Examples

>>> # enable analytics "helloworld" on the company 406e0dcc965a0f56891f3862
>>> sdk.analytics.enable('helloworld', '406e0dcc965a0f56891f3862')
>>> # enable both analytics "helloworld" and "helloworld2"
>>> sdk.analytics.enable(['helloworld', 'helloworld2'], '406e0dcc965a0f56891f3862')
>>> # enable both analytics "helloworld" and "helloworld2" on many companies
>>> sdk.analytics.enable(['helloworld', 'helloworld2'],
...                      ['406e0dcc965a0f56891f3863', '406e0dcc965a0f56891f3862'])
Return type

Dict

expose(analytics, root_companies, **kwargs)

Make the given analytics visible to the given domains.

Parameters
  • analytics (Union[str, List[str]]) – Name of the analytic to expose or list of such names.

  • root_companies (Union[str, List[str]]) – Root company identifier of the domain you want to expose the analytics, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Examples

>>> # expose analytics "helloworld" to the root company 406e0dcc965a0f56891f3860
>>> sdk.analytics.expose('helloworld', '406e0dcc965a0f56891f3860')
>>> # expose both analytics "helloworld" and "helloworld2"
>>> sdk.analytics.expose(['helloworld', 'helloworld2'], '406e0dcc965a0f56891f3860')
>>> # expose both analytics "helloworld" and "helloworld2" to many root companies
>>> sdk.analytics.expose(['helloworld', 'helloworld2'],
...                      ['406e0dcc965a0f56891f3860', '406e0dcc965a0f56891f3861'])
Return type

Dict

order(analytic=None, *, name=None, version=None, inputs=None, parameters=None, deliverables=None, project=None, mission=None, **kwargs)

Order an analytic.

The analytic to order can be specified by identifier using the analytic argument, or by name using the name argument.

When using the name argument to select the analytic but version is equal to None, the analytic with highest version matching name is ordered. The argument version can be used to order the analytic with a specific version. When version is a version range, the analytic with highest version within the specified range will be ordered.

Note that version is expected to follow the syntax defined by npm.

Parameters
  • analytic (Optional[str]) – Identifier of the analytic to order.

  • name (Optional[str]) – Name of the analytic to order.

  • version (Optional[str]) – Optional version or version range used to select the analytic to order when specified by name.

  • inputs (Optional[dict]) – Optional inputs of the analytic.

  • parameters (Optional[dict]) – Optional parameters of the analytic.

  • deliverables (Optional[List[str]]) – List of optional deliverables to generate. When empty or None only required deliverables are generated.

  • project (Optional[str]) – Optional project of the analytic.

  • mission (Optional[str]) – Optional mission of the analytic.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Resource

Returns

The created product description.

Examples

>>> sdk.analytics.order('5d5a73b58cf5360006397aa0',
...     inputs={"ortho": "5d3714e14c50356e2abd1f97"},
...     deliverables=["vehicles"],
...     parameters={"buffer_size": 5.0},
...     project='5d3195209755b0349d0539ad')
Resource(_id='60c331fed5ffbd0012f1f754')
>>> sdk.analytics.order(name='vehicle_detection',
...     version='1.0.x',
...     inputs={"ortho": "5d3714e14c50356e2abd1f97"},
...     deliverables=["vehicles"],
...     parameters={"buffer_size": 5.0},
...     project='5d3195209755b0349d0539ad')
Resource(_id='60c331fed5ffbd0012f1fde8')
search(*, name=None, filter=None, limit=None, page=None, sort=None, return_total=False, **kwargs)

Search for a list of analytics.

Parameters
  • name (Optional[str]) – Optional Analytic name.

  • filter (Optional[Dict]) – Search filter dictionary (refer to /search-analytics definition in the Analytics-service API for a detailed description of filter).

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 0).

  • sort (Optional[dict]) – Optional. Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A list of analytics resources OR a namedtuple

with total number of results and list of analytics resources.

Return type

Analytics

search_generator(*, filter=None, limit=50, page=None, **kwargs)

Return a generator to search through analytics.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found analytics are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • page (Optional[int]) – Optional page number to start the search at (default is 0).

  • filter (Optional[dict]) – Search filter dictionary.

  • limit (int) – Optional maximum number of results by search request (default to 50).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found analytics.

share_with_company(analytic, *, company, **kwargs)
Allow a company to view, order, etc. the analytic.

Deprecated in favor of expose() and enable()

Parameters
  • analytic (str) – Identifier of the analytic to update.

  • company (str) – Identifier of the company to share the analytic with.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

unexpose(analytics, root_companies, **kwargs)

Make the given analytics invisible to the given domains.

Parameters
  • analytics (Union[str, List[str]]) – Name of the analytic to unexpose or list of such names.

  • root_companies (Union[str, List[str]]) – Root company identifier of the domain you want to unexpose the analytics, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Examples

>>> # unexpose analytics "helloworld" from the root company 406e0dcc965a0f56891f3860
>>> sdk.analytics.unexpose('helloworld', '406e0dcc965a0f56891f3860')
>>> # unexpose both analytics "helloworld" and "helloworld2"
>>> sdk.analytics.unexpose(['helloworld', 'helloworld2'], '406e0dcc965a0f56891f3860')
>>> # unexpose both analytics "helloworld" and "helloworld2" from many root companies
>>> sdk.analytics.unexpose(['helloworld', 'helloworld2'],
...                        ['406e0dcc965a0f56891f3860', '406e0dcc965a0f56891f3861'])
Return type

Dict

unshare_with_company(analytic, *, company, **kwargs)
Stop sharing the analytic with a company.

Deprecated in favor of unexpose() and disable()

Parameters
  • analytic (str) – Identifier of the analytic to update.

  • company (str) – Identifier of the company to stop sharing the analytic with.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Analytic Configurations

class AnalyticConfigurationsImpl(analytics_service_api, **kwargs)
assign_to_company(configuration_set, *, company, **kwargs)

Assign an analytic configuration set to a company.

All analytic configurations that are currently part of this analytic configuration set (and the potential future ones) are assigned to the company.

Parameters
  • configuration_set (str) – Identifier of the configuration set to assign.

  • company (str) – Id of the company the analytic configuration set is assigned to.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A relation object containing Ids of Company, Analytic, and Configuration set.

Return type

Dict

create(name, analytic_name, value, analytic_version_range='*', description=None, **kwargs)

Create a new configuration set for an analytic.

Parameters
  • name (str) – Configuration set name.

  • analytic_name (str) – Analytic name.

  • value (Dict[str, Any]) – Raw contents of the associated configuration.

  • analytic_version_range (str) – Optional version range of the analytic on which the configuration set can be applied (default: *).

  • description (Optional[str]) – Optional description.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Raises

ResponseError – The creation response is incorrect.

Returns

The created configuration set resource.

Return type

Resource

delete(configuration_set, **kwargs)

Delete the specified analytic configuration set and the associated configuration(s).

Parameters
  • configuration_set (Union[str, List[str]]) – Identifier of the configuration set to delete, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

None

describe(configuration_set, **kwargs)

Describe an analytic configuration set or a list of analytic configuration sets.

Parameters
  • configuration_set (Union[str, List[str]]) – Identifier of the configuration to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[Resource, List]

Returns

The configuration set resource or a list of configuration set resources.

search(*, filter=None, fields=None, limit=100, page=None, sort=None, return_total=False, **kwargs)

Search analytic configuration sets.

Parameters
  • filter (Optional[dict]) – Optional Search filter (refer to /search-analytic-configurations definition in the Analytic service API for a detailed description of supported operators).

  • fields (Optional[dict]) – Optional Field names to include or exclude from the response. {"include: ["name", "creation_date"]} {"exclude: ["name", "creation_date"]} Do not use both include and exclude.

  • limit (int) – Optional Maximum number of results to extract (default is 100).

  • page (Optional[int]) – Optional Page number (starting at page 0).

  • sort (Optional[dict]) – Optional Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[ResourcesWithTotal, List[Resource]]

Returns

A list of resources OR a namedtuple with total number of results and list of resources.

Examples

>>> # search configuration sets with name exactly equals to 'my config'
>>> sdk.analytic_configurations.search(filter={'name': {'$eq': 'my config'}})
[Resource(_id='506e0dcc965a0f56891f3860'), ...]
>>> # search configuration sets having 'my' in their name (case-insensitive)
>>> sdk.analytic_configurations.search(filter={'name': {'$match': 'my'}})
[Resource(_id='506e0dcc965a0f56891f3860'), ...]
>>> # search configuration sets by IDs (should use analytic_configurations.describe() instead)
>>> sdk.analytic_configurations.search(filter={'_id': {'$eq': '506e0dcc965a0f56891f3860'}})
[Resource(_id='506e0dcc965a0f56891f3860'), ...]
>>> # search configuration sets of a wanted analytic (can also use '$in')
>>> sdk.analytic_configurations.search(filter={'analytic_name': {'$eq': 'my_analytic'}})
[Resource(_id='506e0dcc965a0f56891f3860'), ...]
>>> # search configuration sets updated after December 15th 2021
>>> sdk.analytic_configurations.search(filter={'modification_date': {'$gt': '2021-12-15T00:00:00'}})
[Resource(_id='506e0dcc965a0f56891f3860'), ...]
>>> # get second page of the same search
>>> sdk.analytic_configurations.search(filter={...}, page=1)
[Resource(_id='61924899669e6e0007f8d261'), ...]
>>> # search 400 first configuration sets sorted by name ascending, in 2 calls
>>> sdk.analytic_configurations.search(sort={'name': 1}, limit=200)
[Resource(_id='506e0dcc965a0f56891f3860'), ...]
>>> sdk.analytic_configurations.search(sort={'name': 1}, limit=200, page=1)
[Resource(_id='61924899669e6e0007f8d261'), ...]
>>> # search configuration sets and also get the total results
>>> sdk.analytic_configurations.search(filter={...}, return_total=True)
ResourcesWithTotal(total=940, results=[Resource(_id='506e0dcc965a0f56891f3860'), ...])
search_generator(*, filter=None, fields=None, limit=100, page=None, sort=None, **kwargs)

Return a generator to search through analytic configuration sets.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found configuration sets are sorted chronologically by default in order to allow new resources to be found during the search.

Parameters
  • filter (Optional[dict]) – Optional filter dictionary from search() method.

  • fields (Optional[dict]) – Optional fields dictionary from search() method.

  • limit (int) – Optional maximum number of results by search request (default is 100).

  • page (Optional[int]) – Optional page number to start the search at (default is 0).

  • sort (Optional[dict]) – Optional sort dictionary from search() method.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found analytic configuration sets.

Examples

>>> # get all configurations matching filter by using generator
>>> results_iterator = sdk.analytic_configurations.search_generator(filter={...})
>>> configurations = [r for r in results_iterator]
unassign_from_company(configuration_set, *, company, **kwargs)

Unassign an analytic configuration set from a company.

Parameters
  • configuration_set (str) – Identifier of the configuration set to assign.

  • company (str) – Id of the company the analytic configuration set is assigned to.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

update(configuration_set, *, name=None, description=None, versions=None, value=None, analytic_version_range=None, **kwargs)

Update an analytic configuration set.

At least one of name, description`, versions, or the couple value + analytic_version_range must be present. The couple value + analytic_version_range can be used if you had only one associated configuration, because it will erase all previous ones. If you have multiple configurations in your configuration set, you must use versions.

Parameters
  • configuration_set (str) – Identifier of the configuration set to update.

  • name (Optional[str]) – Optional new configuration set name.

  • description (Optional[str]) – Optional new description.

  • versions (Optional[List[Dict[str, Any]]]) – Optional new associated configurations. It’s a list of objects, each object must have both properties analytic_version_range and value. It will replace all previous configurations in the configuration set.

  • value (Optional[Dict[str, Any]]) – Optional new raw contents of the configuration, must be used with analytic_version_range (do not use with versions). If this param is given, all previous configurations will be erased and replaced by one version containing this value and analytic_version_range.

  • analytic_version_range (Optional[str]) – Optional version range of the analytic on which the first configuration can be applied, must be used with value (do not use with versions). Useless if value is not given.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated analytic configuration set resource.

Return type

Resource

Examples

>>> # update configuration set's name
>>> sdk.analytic_configurations.update('506e0dcc965a0f56891f3860', name='new name')
Resource(_id='506e0dcc965a0f56891f3860')
>>> # replace all configurations of the configuration set by a single new one
>>> sdk.analytic_configurations.update('506e0dcc965a0f56891f3860',
>>>     value={'...': '...'},
>>>     analytic_version_range='1.x',
>>> )
Resource(_id='506e0dcc965a0f56891f3860')
>>> # replace all configurations of the configuration set by multiple new ones
>>> sdk.analytic_configurations.update('506e0dcc965a0f56891f3860',
>>>     versions=[
>>>         {'value': {'...': '...'}, 'analytic_version_range': '1.x' },
>>>         {'value': {'...': '...'}, 'analytic_version_range': '1.7.x' },
>>>         {'value': {'...': '...'}, 'analytic_version_range': '2.x' },
>>>     ]
>>> )
Resource(_id='506e0dcc965a0f56891f3860')

Annotations

class AnnotationsImpl(annotations_api, sdk, **kwargs)
class Icons(value)

An enumeration.

add_attachments(annotation, *, attachments=None, file_paths=None, **kwargs)

Attach datasets to the annotation.

An attachment is a reference to a dataset handled by the Data Management API.

Items of the file_paths argument are interpreted as file paths on the host file system. For each item, a dataset is created and the file at the given path is uploaded. The dataset will be attached to the created annotation.

The created dataset has the following properties:

  • It’s type is equal to file or image depending on the local file MIME type.

  • It belongs to the same project as the annotation.

  • It’s named is equal to the basename of the local file.

For fine control of the dataset type, mission, published status, etc. or when the dataset has multiple components, one must create the dataset separately and use the attachment argument.

Parameters
  • annotation (str) – Identifier of the annotation to attach to.

  • attachments (Optional[List[str]]) – Identifiers of dataset to attach to the annotation.

  • file_paths (Optional[List[str]]) – List of file path to upload and attach to the annotation.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

create(*, project, mission=None, geometry=None, stroke=None, stroke_dasharray=None, icon=None, stroke_width=None, stroke_opacity=None, fill=None, fill_opacity=None, type='2d', target=None, name=None, description=None, followers=None, attachments=None, file_paths=None, normals=None, **kwargs)

Create an annotation.

Items of the file_paths argument are interpreted as file paths on the host file system. For each item, a dataset is created and the file at the given path is uploaded. The dataset will be attached to the created annotation.

Refer to add_attachments() for details on the properties of the created datasets.

Parameters
  • project (str) – Identifier of project to annotate.

  • mission (Optional[str]) – Identifier of mission to annotate.

  • type (str) – Annotation type (must be one of 2d, 3d and image).

  • geometry (Optional[dict]) – Geojson geometry of the annotation.

  • stroke (Optional[List[int]]) – Color used as annotation stroke list of integer [r,g,b] or [r,g,b,a].

  • stroke_dasharray (Optional[List[int]]) – List of integer for dasharray display (specify intervals of line and break).

  • icon (Union[Icons, str, None]) – Icon string or enum. Used for point annotations. Enum can be retrieved through sdk.annotations.Icons (default: sdk.annotations.Icons.ANNOTATE).

  • stroke_width (Optional[float]) – Width of stroke.

  • stroke_opacity (Optional[float]) – Opacity of stroke between 0 and 1.

  • fill (Optional[List[int]]) – Color used as fill for annotation list of integer [r,g,b] or [r,g,b,a]

  • fill_opacity (Optional[float]) – Opacity of fill between 0 and 1.

  • target (Optional[str]) – Identifier of the dataset to annotate.

  • name (Optional[str]) – Annotation name.

  • description (Optional[str]) – Annotation description.

  • followers (Optional[List[str]]) – Identifiers of users following the annotation.

  • attachments (Optional[List[str]]) – Identifiers of datasets to attach to the annotation.

  • file_paths (Optional[List[str]]) – List of file paths to upload and attach to the annotation.

  • normals (Optional[List]) – Transformation vector used to transform the geometry on the front-end (for 3D datasets).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

The created annotation.

Return type

Resource

Examples

>>> sdk.annotations.create(
...    project='5d63cf9743d61400078efaf8',
...    geometry={
...        "type": "Point",
...        "coordinates": [1440.8495575221236, 1144.8259587020648]
...    },
...    name='My point annotation',
...    type='image',
...    target='5d63cf972fb3880011e57e34',
...    icon=sdk.annotations.Icons.CONVEYOR,
...    followers=['5d5fa52bc207040006390244'],
...    attachments=['5d63cf972fb3880011e57e32']
... )
Resource(_id='5a5155ae8dcb064fcbf4ae35')
create_annotations(annotations, **kwargs)

Create several annotations.

Parameters
  • annotations (List[dict]) – List of annotation descriptions, each description is a dictionary with keys among arguments of create().

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

List[Resource]

Returns

Descriptions of the created annotations.

delete(annotation, **kwargs)

Delete an annotation or multiple annotations.

Parameters
  • annotation (Union[str, List[str]]) – Identifier of the annotation to delete, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

describe(annotation, **kwargs)

Describe a dataset or a list of datasets.

Parameters
  • annotation (Union[str, List[str]]) – Identifier of the annotation to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[Resource, List[Resource]]

Returns

The annotation description or a list of annotation description.

remove_attachments(annotation, *, attachments, **kwargs)

Remove attachment to the annotation.

Parameters
  • annotation (str) – Identifier of the annotation to remove attachments from.

  • attachments (Union[str, List[str]]) – Identifier of attachments to remove.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

rename(annotation, *, name, **kwargs)

Rename the annotation.

Parameters
  • annotation (str) – Identifier of the annotation to rename.

  • name (str) – New name of the annotation.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

restore(annotation, **kwargs)

Restore an annotation or multiple annotations.

Parameters
  • annotation (Union[str, List[str]]) – Identifier of the annotation to restore, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

search(*, project=None, filter=None, limit=None, page=None, sort=None, return_total=False, **kwargs)

Search annotations.

Parameters
  • project (Optional[str]) – Optional identifier of a project to search annotations for.

  • filter (Optional[dict]) – Search filter dictionary (refer to /search-annotations in the Annotation API specification for a detailed description).

  • limit (Optional[int]) – Optional Maximum number of results.

  • page (Optional[int]) – Optional Page number (starting at page 1).

  • sort (Optional[dict]) – Optional. Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[ResourcesWithTotal, List[Resource]]

Returns

A list of annotation descriptions or a namedtuple with total number of results and list of annotation descriptions.

search_generator(*, filter=None, limit=50, page=None, **kwargs)

Return a generator to search through annotations.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found annotations are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • page (Optional[int]) – Optional page number to start the search at (default is 0).

  • filter (Optional[dict]) – Search filter dictionary.

  • limit (int) – Optional maximum number of results by search request.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found annotations.

set_description(annotation, *, description, **kwargs)

Set the annotation description.

Parameters
  • annotation (str) – Identifier of the annotation whose description to set.

  • description (str) – Description of the annotation.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

set_fill_color(annotation, *, color, opacity=None, **kwargs)

Set the color used to fill the annotation.

Parameters
  • annotation (str) – Identifier of the annotation whose fill color to set.

  • color (List[float]) – Fill color to set interpreted as an RGB-triple.

  • opacity (Optional[float]) – Optional opacity of fill color, a float number between 0 and 1.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

set_fill_opacity(annotation, *, opacity, **kwargs)

Set the opacity of the annotation fill.

Parameters
  • annotation (str) – Identifier of the annotation whose fill opacity to set.

  • opacity (float) – Fill opacity to set.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

set_geometry(annotation, *, geometry, **kwargs)

Set the geometry of the annotation.

Parameters
  • annotation (str) – Identifier of the annotation whose geometry to set.

  • geometry (dict) – A dictionary following GeoJSON specification.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

set_icon(annotation, *, icon=None, **kwargs)

Set the annotation icon.

Parameters
  • annotation (str) – Identifier of the annotation whose icon to set.

  • icon (Union[Icons, str, None]) – Icon string or enum. Used for point annotations. Enum can be retrieved through sdk.annotations.Icons (default: sdk.annotations.Icons.ANNOTATE).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

set_normals(annotation, *, normals, **kwargs)

Set the annotation normal vectors.

Setting the normals of an annotation makes sense for annotations of type 3d only. The argument normals is expected to be a list of 3-dimensional vectors, one for each vertice of the annotation geometry. Those vectors are interpreted as normals to the target of the annotation and are used to shift the annotation geometry when it is drawn so that it doesn’t overlap the target of the annotation and is drawn on the right side of the target facets.

Parameters
  • annotation (str) – Identifier of the annotation whose normal vector to set.

  • normals (List) – List of coordinates of normal vectors.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

set_stroke_color(annotation, *, color, opacity=None, **kwargs)

Set the stroke color of the annotation.

Parameters
  • annotation (str) – Identifier of the annotation whose stroke color to set.

  • color (Tuple[int, int, int]) – Stroke color to set interpreted as an RGB-triple.

  • opacity (Optional[float]) – Optional opacity of stroke color, a float number between 0 and 1.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

set_stroke_dasharray(annotation, *, dasharray, **kwargs)

Set the dasharray of the annotation stroke.

The dasharray defines the pattern of dashes and gaps used to paint the outline of the annotation.

Parameters
  • annotation (str) – Identifier of the annotation whose stroke opacity to set.

  • dasharray (List[float]) – Dasharray to set.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

set_stroke_opacity(annotation, *, opacity, **kwargs)

Set the opacity of the annotation stroke.

Parameters
  • annotation (str) – Identifier of the annotation whose stroke opacity to set.

  • opacity (float) – Stroke opacity to set.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

set_stroke_width(annotation, *, width, **kwargs)

Set the stroke width of the annotation.

Parameters
  • annotation (str) – Identifier of the annotation whose stroke width to set.

  • width (float) – Stroke width to set.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Carriers

class CarriersImpl(asset_management_api, **kwargs)
create(*, carrier_model, team, serial_number, firmware=None, status=None, comment=None, **kwargs)

Create a carrier.

Parameters
  • carrier_model (str) – Identifier of the carrier model.

  • team (str) – Identifier of the team.

  • serial_number (str) – Serial number of the carrier.

  • firmware (Optional[str]) – Optional firmware.

  • status (Optional[str]) – Optional status, among ready, in-maintenance, out-of-service.

  • comment (Optional[str]) – Optional comment.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A carrier resource.

Return type

Resource

delete(carrier, **kwargs)

Delete a carrier.

Parameters

carrier (str) – Identifier of the carrier to delete.

describe(carrier, **kwargs)

Describe a carrier or a list of carriers.

Parameters
  • carrier (Union[str, List[str]]) – Identifier of the carrier to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

The carrier description or a list of carriers descriptions.

Return type

Resource

search(*, filter=None, limit=None, page=None, sort=None, **kwargs)

Search carriers.

Parameters
  • filter (Optional[dict]) – Search filter dictionary.

  • limit (Optional[int]) – Maximum number of results to extract.

  • page (Optional[int]) – Page number (starting at page 0).

  • sort (Optional[dict]) – Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A list of carrier resources.

Return type

Resources

Carrier models

class CarrierModelsImpl(asset_management_api, **kwargs)
create(*, name, maker, type, company=None, unloaded_weight=None, flight_time=None, speed=None, altitude=None, compatible_sensor_models=None, **kwargs)

Create a carrier model.

Parameters
  • name (str) – Carrier model name.

  • maker (str) – Maker name.

  • type (str) – Model type, among``fixed-wind``, multirotor, ground-robot,

  • helicopter

  • pedestrian.

  • company (Optional[str]) – Optional identifier of the company.

  • unloaded_weight (Optional[dict]) – Optional unloaded weight { value: weight without sensor, unit: unit (g, kg) }.

  • flight_time (Optional[dict]) – Optional flight time { value: maximum flight time, unit: unit (min) }.

  • speed (Optional[dict]) – Optional speed { min: {value, unit}, max: {value, unit(m/s, mph ,ft/s, km/h, knot)} }.

  • altitude (Optional[dict]) – Optional altitude { min: {value, unit}, max: {value, unit(m, ft)} }.

  • compatible_sensor_models (Optional[List[str]]) – Optional list of compatible sensors identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A carrier model resource.

Return type

Resource

delete(carrier_model, **kwargs)

Delete a carrier model.

Parameters

carrier_model (str) – Carrier model to delete.

describe(carrier_models, **kwargs)

Describe a carrier model or a list of carrier models.

Parameters
  • carrier_models (Union[str, List[str]]) – Identifier of the carrier model to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

The carrier model description

or a list of carrier model descriptions.

Return type

Resource

search(*, filter=None, limit=None, page=None, sort=None, **kwargs)

Search carrier models.

Parameters
  • filter (Optional[dict]) – Search filter dictionary.

  • limit (Optional[int]) – Maximum number of results to extract.

  • page (Optional[int]) – Page number (starting at page 0).

  • sort (Optional[dict]) – Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A list of carrier models resources.

Return type

Resources

Collections

class CollectionsImpl(features_service_api, **kwargs)
create(*, name=None, features=None, properties=None, schema=None, **kwargs)

Create a collection.

Parameters
  • name (Optional[str]) – The name of the collection to create.

  • features (Optional[List[str]]) – List of feature identifiers.

  • properties (Optional[dict]) – Dictionary of properties.

  • schema (Optional[dict]) – JSON schema of the collection.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Resource

Returns

Resource for the created collection.

create_collections(descriptions, **kwargs)

Create collections.

Parameters
  • descriptions (Iterable[dict]) – List of collections descriptions, each description is a dictionary with keys among arguments of create().

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

List[Resource]

Returns

List of resource for the created collections.

delete(collection, *, permanent=False, **kwargs)

Delete a collection or multiple collections.

Parameters
  • collection (Union[str, List[str]]) – Identifier of the collection to delete, or list of such identifiers.

  • permanent (bool) – Whether to delete collections permanently or not. Default to False.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

describe(collection, **kwargs)

Describe a collection or a list of collections.

Parameters
  • collection (Union[str, List[str]]) – Identifier of the collection to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[Resource, List[Resource]]

Returns

The fature description or a list of collection description.

export(collection, target_path, target_name, format_requested='geojson')

Export a collection to the given format.

Parameters
  • collection (str) – Identifier of the collection.

  • target_path (str) – Path where the file will be download.

  • target_name (str) – Name given to the downloaded file.

  • format_requested (str) – Format of the export.

Returns

File path of the download file.

restore(collection, **kwargs)

Restore a collection or multiple collections.

Parameters
  • collection (Union[str, List[str]]) – Identifier of the collection to restore, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Collection tasks

class CollectionTaskImpl(collection_task_api, collection_task_management_api, **kwargs)
create(*, name, company, site=None, survey=None, location=None, forecast_date_range=None, scheduled_date_range=None, team=None, pic=None, comment=None, custom_props=None, requirement=None, purpose=None, **kwargs)

Create a collection task.

Parameters
  • name (str) – Collection task name.

  • company (str) – Identifier of the company.

  • site (Optional[str]) – Optional site identifier.

  • survey (Optional[str]) – Optional survey identifier.

  • location (Optional[dict]) – Optional location { adress: {street, zipcode, city},  contact: {name, phone, email}, task_area: {} }

  • forecast_date_range (Optional[dict]) – Optional forecast date range { start_date, end_date}.

  • scheduled_date_range (Optional[dict]) – Optional scheduled date range { start_date, end_date}.

  • team (Optional[str]) – Optional team identifier.

  • pic (Optional[str]) – Optional pilot in charge identifier.

  • comment (Optional[str]) – Optional comment.

  • custom_props (Optional[dict]) – Optional custom properties.

  • requirement (Optional[dict]) – Optional requirement.

  • purpose (Optional[str]) – Optional purpose.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A collection task resource.

Return type

Resource

create_flight_log(task, **kwargs)

Create or update the collection task flight log.

Parameters
  • task (str) – Collection task whose flight log needs to be created or updated.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A collection task resource.

Return type

Resource

delete(task, **kwargs)

Delete a collection task.

Parameters

task (str) – Collection task to delete.

describe(task, *, fields=None, **kwargs)

Describe a collection task.

Parameters
  • task (Union[str, List[str]]) – Identifier of the collection task to describe, or list of such identifiers.

  • fields (Optional[dict]) – Optional Field names to include or exclude from the response. {"include: ["name", "creation_date"]} {"exclude: ["name", "creation_date"]} Do not use both include and exclude.

Returns

The collection task description

or a list of collection task descriptions.

Return type

Resource

rename(task, *, name, **kwargs)

Rename a collection task.

Parameters
  • task (str) – Collection task to rename.

  • name (str) – New task name.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

The renamed collection task.

Return type

Resource

search(*, filter=None, limit=None, page=None, sort=None, return_total=False, **kwargs)

Search collection tasks.

Parameters
  • filter (Optional[dict]) – Search filter dictionary.

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 0).

  • sort (Optional[dict]) – Optional Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A list of collection task resources.

Return type

Resources

search_generator(*, filter=None, limit=50, page=None, **kwargs)

Return a generator to search through collection tasks.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found collection tasks are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • page (Optional[int]) – Optional page number to start the search at (default is 0).

  • filter (Optional[dict]) – Search filter dictionary.

  • limit (int) – Optional maximum number of results by search request (default to 50).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found collection tasks.

set_task_status(task, *, status, **kwargs)

Update the status of a collection task

Parameters
  • task (str) – Collection task identifier.

  • status (str) – The new status to set among “pending”, “ready”, “assigned”, “scheduled”, “data-captured”, “data-submitted” and “completed”

Returns

A collection task resource.

Return type

Resource

update(task, *, name=None, site=None, survey=None, location=None, forecast_date_range=None, scheduled_date_range=None, team=None, pic=None, comment=None, custom_props=None, requirement=None, purpose=None, **kwargs)

Update a collection task.

Parameters
  • task (str) – Collection task identifier.

  • name (Optional[str]) – Optional collection task name.

  • site (Optional[str]) – Optional site identifier.

  • survey (Optional[str]) – Optional survey identifier.

  • location (Optional[dict]) – Optional location { adress: {street, zipcode, city},  contact: {name, phone, email}, task_area: {} }

  • forecast_date_range (Optional[dict]) – Optional forecast date range { start_date, end_date}.

  • scheduled_date_range (Optional[dict]) – Optional scheduled date range { start_date, end_date}.

  • team (Optional[str]) – Optional team identifier.

  • pic (Optional[str]) – Optional pilot in charge identifier.

  • comment (Optional[str]) – Optional comment.

  • custom_props (Optional[dict]) – Optional custom properties.

  • requirement (Optional[dict]) – Optional requirement.

  • purpose (Optional[str]) – Optional purpose.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A collection task resource.

Return type

Resource

Comments

class CommentsImpl(project_manager_api, sdk, **kwargs)
create(text, *, project, type, target=None, flight=None, **kwargs)

Create a comment.

Parameters
  • text (str) – Comment content.

  • project (str) – Identifier of project to comment.

  • type (str) – Comment type (must be one of project, annotation, flight, photo, dataset, feature, gcp, task).

  • target (Optional[str]) – Optional identifier of the target.

  • flight (Optional[str]) – Optional identifier of the flight (mandatory when the comment type is photo).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

The created comment.

Return type

Resource

Examples

>>> sdk.comments.create(
...    text='my comment',
...    project='5d63cf972fb3880011e57f22',
...    type='dataset',
...    target='5d63cf972fb3880011e57e34')
Comment(_id='5d5155ae8dcb064fcbf4ae35')
mark_as_read(*, project, type=None, target=None, flight=None, **kwargs)

Mark all the comments of a target or project as read.

Parameters
  • project (str) – Identifier of project.

  • type (Optional[str]) – Optional comment type (must be one of project, annotation, flight, photo, dataset, feature, gcp, task).

  • target (Optional[str]) – Optional identifier of the target.

  • flight (Optional[str]) – Optional identifier of the flight (mandatory when the comment type is photo).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Examples

>>> sdk.comments.mark_as_read(
...    project='5d63cf972fb3880011e57f22',
...    type='dataset',
...    target='5d63cf972fb3880011e57e34')
Return type

None

search(*, project, type=None, target=None, flight=None, **kwargs)

Search for comments.

When searching for comments on a photo. Both the flight id and target id must be supplied.

Parameters
  • project (str) – Identifier of the project.

  • type (Optional[str]) – Optional comment type (must be one of project, annotation, flight, photo, dataset, feature, gcp, task).

  • target (Optional[str]) – Optional identifier of the target.

  • flight (Optional[str]) – Optional identifier of the flight (mandatory when the comment type is photo).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

The found comments.

Return type

Resources

Examples

>>> sdk.comments.search(project='5d63cf972fb3880011e57f22')
[Comment(_id='5d5155ae8dcb064fcbf4ae35'), ...]

Companies

class CompaniesImpl(auth_api, **kwargs)
describe(company, **kwargs)

Describe a company or multiple companies.

Parameters
  • company (Union[str, List[str]]) – Identifier of the company to describe, or list of

  • identifiers. (such) –

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[Resource, List[Resource]]

Returns

The company description or a list of company description.

search(*, filter=None, limit=None, page=None, sort=None, return_total=False, **kwargs)

Search companies.

Parameters
  • filter (Optional[dict]) – Search filter (refer to /search-companies definition in the User and company management API for a detailed description of supported operators).

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 1).

  • sort (Optional[dict]) – Optional. Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Resources: A list of resources OR a namedtuple

with total number of results and list of resources.

Return type

Union[ResourcesWithTotal, List[Resource]]

search_generator(*, filter=None, limit=50, page=None, **kwargs)

Return a generator to search through companies.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found companies are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • page (Optional[int]) – Optional page number to start the search at (default is 1).

  • filter (Optional[dict]) – Search filter dictionary.

  • limit (int) – Optional maximum number of results by search request (default to 50).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found companies.

Credentials

class CredentialsImpl(credentials_service_api, **kwargs)
create(*, name, credentials, credentials_type=None, **kwargs)

Create a credential entry.

Parameters
  • name (str) – Credential name (must be unique).

  • credentials_type (Optional[str]) – Credentials type (docker or object-storage)

  • credentials (Dict[str, str]) – Credential dict.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Resource

Returns

The created credential description.

Examples

>>> sdk.credentials.create(name="My Docker registry",
...     credentials_type="docker"
...     credentials={
...         "type": "docker",
...         "login": "my_login",
...         "password": "my_password",
...         "registry": "mydockerregistry.com"
...     }
... )
Resource(_id='5e5155ae8dcb064fcbf4ae35')
>>> sdk.credentials.create(name="My aws registry",
...     credentials_type="docker"
...     credentials={
...         "type": "aws",
...         "aws_access_key_id": "key_id",
...         "aws_secret_access_key": "password_test",
...         "aws_region": "us-east-1",
...         "registry": "XXX.dkr.ecr.us-east-1.amazonaws.com"
...     }
... )
Resource(_id='5e6155ae8dcb064fcbf4ae35')
>>> sdk.credentials.create(name="My bucket S3",
...     credentials_type="object-storage"
...     credentials={
...         "type": "s3",
...         "aws_access_key_id": "key_id",
...         "aws_secret_access_key": "password_test",
...         "aws_region": "us-east-1",
...         "bucket": "XXX.s3.us-east-1.amazonaws.com/key"
...     }
... )
Resource(_id='5e6155ae8dcb064fcbf4ae35')
>>> sdk.credentials.create(name="My azure blob",
...     credentials_type="object-storage"
...     credentials={
...         "type": "azure-blob",
...         "azure_client_id": "key_id",
...         "azure_tenant_id": "tenant-id",
...         "azure_client_secret": "client_secret",
...         "account_url": "https://mystorage.blob.core.windows.net"
...     }
... )
Resource(_id='5e6155ae8dcb064fcbf4ae35')
>>> sdk.credentials.create(name="My stac catalog",
...     credentials_type="stac-catalog"
...     credentials={
...         "type": "oauth",
...         "client_id": "key_id",
...         "client_secret": "client_secret",
...         "token_url": "https://token_url",
...         "catalog": "https://catalog_url",
...     }
... )
Resource(_id='5e6155ae8dcb064fcbf4ae35')
delete(credential, **kwargs)

Delete a credential entry.

Parameters
  • credential (str) – Credential identifier.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

None

search(*, name=None, filter=None, limit=None, page=None, sort=None, return_total=False, **kwargs)

Search for a list of credentials.

Parameters
  • name (Union[str, List[str], None]) – Credential name, should be a string or list of string.

  • filter (Optional[Dict]) – Search filter dictionary (refer to /search-credentials definition in the Credentials Service API for a detailed description of filter).

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 0).

  • sort (Optional[dict]) – Optional Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A list of credential resources OR a namedtuple

with total number of results and list of credential resources.

Return type

Credentials

Datasets

class DatasetsImpl(data_management_api, sdk, **kwargs)
add_categories(dataset, *, categories, **kwargs)

Add categories to the dataset.

Parameters
  • dataset (str) – Identifier of the dataset to add categories to.

  • categories (List[str]) – Categories to add.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

create_datasets(datasets)

Create several datasets (bulk dataset creation).

Parameters

datasets (List[dict]) – List of dataset dictionnaries (refer to /create-datasets definition in the Data Manager API for a detailed description of datasets)

Return type

List[Resource]

Returns

A list of the created dataset descriptions.

Example

>>> sdk.datasets.create_datasets(
... datasets=[{'name': 'My file dataset',
...            'project': '4037636c9a406900074dc253',
...            'type': 'file',
...            'components': [{'name': 'kind_of_file'}]},
...           {'name': 'My image',
...            'type': 'image',
...            'project': '4037636c9a406900074dc253',
...            'components': [{'name': 'image'}]}])
[Resource(_id='406ee155647ec6006df3aa21'), ...]
create_file_dataset(*, name, categories=None, company=None, project=None, mission=None, hidden=None, published=None, horizontal_srs_wkt=None, vertical_srs_wkt=None, dataset_format=None, geometry=None, properties=None, file_count=1, components=None, **kwargs)

Create a dataset of type file.

One of company or project must be defined.

Parameters
  • name (str) – Name of the dataset.

  • categories (Optional[Sequence[str]]) – Sequence of categories or None if there’s no category to set on the dataset.

  • company (Optional[str]) – Optional company identifier.

  • project (Optional[str]) – Optional project identifier.

  • mission (Optional[str]) – Optional mission identifier.

  • hidden (Optional[bool]) – Whether not to display the dataset to end-users or not.

  • published (Optional[bool]) – Whether the dataset is ready for delivery or not.

  • horizontal_srs_wkt (Optional[str]) – Optional geographic coordinate system for horizontal coordinattes in WKT format.

  • vertical_srs_wkt (Optional[str]) – Optional geographic coordinate system for vertical coordinattes in WKT format.

  • dataset_format (Optional[str]) – Optional file format.

  • geometry (Optional[dict]) – Optional geometry of the dataset.

  • properties (Optional[dict]) – Optional custom properties of the dataset.

  • file_count (int) – Number of files. Default to 1. It is used to generate the component names automatically, except if components is defined.

  • components (Optional[List[str]]) – Optional sequence of component names. When defined, file_count is ignored.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Resource for the created dataset.

Return type

Resource

create_image_dataset(*, name, categories=None, company=None, project=None, mission=None, flight=None, hidden=None, published=None, horizontal_srs_wkt=None, vertical_srs_wkt=None, dataset_format=None, geometry=None, properties=None, acquisition_date=None, width=None, height=None, sensor=None, lens=None, camera_parameters=None, reflectance_calibration_panel=None, parse_metadata=None, **kwargs)

Create a dataset of type image.

One of company or project must be defined.

Parameters
  • name (str) – Name of the dataset.

  • categories (Optional[Sequence[str]]) – Sequence of categories or None if there’s no category to set on the dataset.

  • company (Optional[str]) – Optional company identifier.

  • project (Optional[str]) – Optional project identifier.

  • mission (Optional[str]) – Optional mission identifier.

  • flight (Optional[str]) – Optional flight identifier.

  • hidden (Optional[bool]) – Whether not to display the dataset to end-users or not.

  • published (Optional[bool]) – Whether the dataset is ready for delivery or not.

  • horizontal_srs_wkt (Optional[str]) – Optional geographic coordinate system for horizontal coordinattes in WKT format.

  • vertical_srs_wkt (Optional[str]) – Optional geographic coordinate system for vertical coordinattes in WKT format.

  • dataset_format (Optional[str]) – Optional file format.

  • geometry (Optional[dict]) – Optional geometry of the dataset.

  • properties (Optional[dict]) – Optional custom properties of the dataset.

  • acquisition_date (Optional[str]) – Optional acquisition date (format: YYYY-MM-DDTHH:MM:SS.sssZ).

  • width (Optional[int]) – Optional image width.

  • height (Optional[int]) – Optional image height.

  • sensor (Optional[dict]) – Optional sensor properties.

  • lens (Optional[dict]) – Optional lens properties.

  • camera_parameters (Optional[dict]) – Optional camera parameters description.

  • reflectance_calibration_panel (Optional[dict]) – Optional reflectance calibration panel description.

  • parse_metadata (Optional[bool]) – Optional ingestion parameter that will populate dataset attributes with parsed Exif & XMP metadata

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Resource for the created dataset.

Return type

Resource

create_mesh_dataset(*, name, categories=None, company=None, project=None, mission=None, hidden=None, published=None, horizontal_srs_wkt=None, vertical_srs_wkt=None, dataset_format=None, geometry=None, properties=None, texture_count=1, material_count=1, offset=None, **kwargs)

Create a dataset of type mesh.

One of company or project must be defined.

Parameters
  • name (str) – Name of the dataset.

  • categories (Optional[Sequence[str]]) – Sequence of categories or None if there’s no category to set on the dataset.

  • company (Optional[str]) – Optional company identifier.

  • project (Optional[str]) – Optional project identifier.

  • mission (Optional[str]) – Optional mission identifier.

  • hidden (Optional[bool]) – Whether not to display the dataset to end-users or not.

  • published (Optional[bool]) – Whether the dataset is ready for delivery or not.

  • horizontal_srs_wkt (Optional[str]) – Optional geographic coordinate system for horizontal coordinattes in WKT format.

  • vertical_srs_wkt (Optional[str]) – Optional geographic coordinate system for vertical coordinattes in WKT format.

  • dataset_format (Optional[str]) – Optional file format.

  • geometry (Optional[dict]) – Optional geometry of the dataset.

  • properties (Optional[dict]) – Optional custom properties of the dataset.

  • texture_count – Number of texture files. Default to 1.

  • material_count – Number of materials files. Defaut to 1.

  • offset (Optional[Tuple[float, float, float]]) – Optional translation from mesh coordinates to spatial coordinates.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Resource for the created dataset.

Return type

Resource

create_pcl_dataset(*, name, categories=None, company=None, project=None, mission=None, hidden=None, published=None, horizontal_srs_wkt=None, vertical_srs_wkt=None, dataset_format=None, geometry=None, properties=None, **kwargs)

Create a dataset of type pcl.

One of company or project must be defined.

Parameters
  • name (str) – Name of the dataset.

  • categories (Optional[Sequence[str]]) – Sequence of categories or None if there’s no category to set on the dataset.

  • company (Optional[str]) – Optional company identifier.

  • project (Optional[str]) – Optional project identifier.

  • mission (Optional[str]) – Optional mission identifier.

  • hidden (Optional[bool]) – Whether not to display the dataset to end-users or not.

  • published (Optional[bool]) – Whether the dataset is ready for delivery or not.

  • horizontal_srs_wkt (Optional[str]) – Optional geographic coordinate system for horizontal coordinattes in WKT format.

  • vertical_srs_wkt (Optional[str]) – Optional geographic coordinate system for vertical coordinattes in WKT format.

  • dataset_format (Optional[str]) – Optional file format.

  • geometry (Optional[dict]) – Optional geometry of the dataset.

  • properties (Optional[dict]) – Optional custom properties of the dataset.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Resource for the created dataset.

Return type

Resource

create_raster_dataset(*, name, categories=None, company=None, project=None, mission=None, hidden=None, published=None, horizontal_srs_wkt=None, vertical_srs_wkt=None, dataset_format=None, geometry=None, properties=None, bands=None, has_projection_file=False, has_worldfile=False, has_headerfile=False, **kwargs)

Create a dataset of type raster.

One of company or project must be defined.

Parameters
  • name (str) – Name of the dataset.

  • categories (Optional[Sequence[str]]) – Sequence of categories or None if there’s no category to set on the dataset.

  • company (Optional[str]) – Optional company identifier.

  • project (Optional[str]) – Optional project identifier.

  • mission (Optional[str]) – Optional mission identifier.

  • hidden (Optional[bool]) – Whether not to display the dataset to end-users or not.

  • published (Optional[bool]) – Whether the dataset is ready for delivery or not.

  • horizontal_srs_wkt (Optional[str]) – Optional geographic coordinate system for horizontal coordinattes in WKT format.

  • vertical_srs_wkt (Optional[str]) – Optional geographic coordinate system for vertical coordinattes in WKT format.

  • dataset_format (Optional[str]) – Optional file format.

  • geometry (Optional[dict]) – Optional geometry of the dataset.

  • properties (Optional[dict]) – Optional custom properties of the dataset.

  • bands (Optional[List[dict]]) – Option list of band properties.

  • has_projection_file (bool) – Whether there is a sidecar file to define the raster projection.

  • has_worldfile (bool) – Whether there is a sidecar file to georeference the raster.

  • has_headerfile (bool) – Whether there is a sidecar file for envi format raster.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Resource for the created dataset.

Return type

Resource

create_vector_dataset(*, name, categories=None, company=None, project=None, mission=None, hidden=None, published=None, collection=None, origin=None, horizontal_srs_wkt=None, vertical_srs_wkt=None, dataset_format=None, geometry=None, properties=None, is_shape_file=False, is_archive=False, has_projection_file=False, **kwargs)

Create a dataset of type vector.

When is_archive is True, is_shape_file and has_projection_file must be False.

One of company or project must be defined.

Parameters
  • name (str) – Name of the dataset.

  • categories (Optional[Sequence[str]]) – Sequence of categories or None if there’s no category to set on the dataset.

  • company (Optional[str]) – Optional company identifier.

  • project (Optional[str]) – Optional project identifier.

  • mission (Optional[str]) – Optional mission identifier.

  • hidden (Optional[bool]) – Whether not to display the dataset to end-users or not.

  • published (Optional[bool]) – Whether the dataset is ready for delivery or not.

  • collection (Optional[str]) – Optional map-service collection to use as data source. Providing a collection isn’t compatible with setting is_shape_file, has_projection_file, is_archive to True, nor setting dataset_format.

  • origin (Optional[str]) – Optional origin vector dataset (source: data-manager) for a vector collection dataset (source: map-service).

  • horizontal_srs_wkt (Optional[str]) – Optional geographic coordinate system for horizontal coordinattes in WKT format.

  • vertical_srs_wkt (Optional[str]) – Optional geographic coordinate system for vertical coordinattes in WKT format.

  • dataset_format (Optional[str]) – Optional file format.

  • geometry (Optional[dict]) – Optional geometry of the dataset.

  • properties (Optional[dict]) – Optional custom properties of the dataset.

  • is_shape_file (bool) – Whether it is an ESRI Shapefile.

  • is_archive (bool) – Whether it is an archive.

  • has_projection_file (bool) – Whether there is a sidecar file to define the shapes projection.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Resource for the created dataset.

Return type

Resource

delete(dataset, **kwargs)

Delete a dataset or multiple datasets.

Parameters
  • dataset (Union[str, List[str]]) – Identifier of the dataset to delete, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

delete_properties(dataset, *, properties, **kwargs)

Delete properties of the dataset.

Parameters
  • dataset (str) – Identifier of the dataset whose properties to delete.

  • properties (List[str]) – Names of properties to delete.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

describe(dataset, **kwargs)

Describe a dataset or a list of datasets.

Parameters
  • dataset (Union[str, List[str]]) – Identifier of the dataset to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[Resource, List[Resource]]

Returns

The dataset description or a list of dataset description.

download_component(dataset, *, component, target_path=None, target_name=None, overwrite=False, md5hash=None)

Download the file from a component.

If the path target_path doesn’t exists, it is created.

Parameters
  • dataset (str) – Identifier of the dataset to download from.

  • component (str) – Name of component to download from.

  • target_path (Optional[str]) – Path of directory where to save the downloaded file. Default to current directory.

  • target_name (Optional[str]) – Name of downloaded file. Default to the file name suggested by the server.

  • overwrite – Whether to overwrite an existing file. Default to False.

  • md5hash (Optional[str]) – Optional MD5 hash of the file to download read in binary mode and containing only hexadecimal digits. When not equal to None (the default), will be compared to the equivalent hash for the downloaded file.

Raises

DownloadError – When the MD5 hash of the downloaded file doesn’t match md5hash.

Return type

str

Returns

Path of the downloaded file.

download_image_as_jpeg(dataset, target_path=None, target_name=None, overwrite=False, md5hash=None)

Download an image as JPEG.

If the path target_path doesn’t exists, it is created.

Parameters
  • dataset (str) – Identifier of the dataset to download from.

  • target_path (Optional[str]) – Path of directory where to save the downloaded file. Default to current directory.

  • target_name (Optional[str]) – Name of downloaded file. Default to the file name suggested by the server.

  • overwrite – Whether to overwrite an existing file. Default to False.

  • md5hash (Optional[str]) – Optional MD5 hash of the file to download read in binary mode and containing only hexadecimal digits. When not equal to None (the default), will be compared to the equivalent hash for the downloaded file.

Raises

DownloadError – When the MD5 hash of the downloaded file doesn’t match md5hash.

Return type

str

Returns

Path of the downloaded file.

download_preview(dataset, kind=None, target_path=None, target_name=None, overwrite=False)

Download a dataset preview.

If the path target_path doesn’t exists, it is created.

Parameters
  • dataset (str) – Identifier of the dataset to download from.

  • kind (Optional[str]) – Size of the preview, only for datasets type image. Must be tiny or small

  • target_path (Optional[str]) – Path of directory where to save the downloaded file. Default to current directory.

  • target_name (Optional[str]) – Name of downloaded file. Default to the file name suggested by the server.

  • overwrite – Whether to overwrite an existing file. Default to False.

Return type

str

Returns

Path of the downloaded file.

remove_categories(dataset, *, categories, **kwargs)

Remove categories from the dataset.

Parameters
  • dataset (str) – Identifier of the dataset to remove categories from.

  • categories (List[str]) – Categories to remove.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

rename(dataset, *, name, **kwargs)

Rename the dataset.

Parameters
  • dataset (str) – Identifier of the dataset to rename.

  • name (str) – New name of the dataset.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

restore(dataset, **kwargs)

Restore a dataset or multiple datasets.

Parameters
  • dataset (Union[str, List[str]]) – Identifier of the dataset to restore, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

search(*, filter=None, limit=None, page=None, sort=None, return_total=False, **kwargs)

Search datasets.

Parameters
  • filter (Optional[dict]) – Search filter dictionary (refer to /search-datasets definition in the Data Manager API for a detailed description of filter).

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 0).

  • sort (Optional[dict]) – Optional. Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[ResourcesWithTotal, List[Resource]]

Returns

A list of dataset descriptions OR a namedtuple with total number of results and list of dataset descriptions.

Examples

>>> sdk.datasets.search(filter={'name': {'$eq': 'My image'}})
[Resource(_id='5c5155ae8dcb064fcbf4ae35'), ...]
>>> sdk.datasets.search(filter={'name': {'$eq': 'My image'}},
...                     return_total=True)
ResourcesWithTotal(
    total=...,
    results=[Resource(_id='5c5155ae8dcb064fcbf4ae35'), ...]
)
search_generator(*, filter=None, limit=50, page=None, count=False, **kwargs)

Return a generator to search through datasets.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found datasets are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • page (Optional[int]) – Optional page number to start the search at (default is 0).

  • filter (Optional[dict]) – Search filter dictionary.

  • limit (int) – Optional maximum number of results by search request (default to 50).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found datasets.

share_tiles(dataset, *, duration=None)

Return a URL template to share access to the tiles of the passed datasets.

Parameters
  • dataset (Union[str, List[str]]) – Identifier of the dataset, or list of such identifiers (for rasters only) to create a URL for.

  • duration (Optional[int]) – Optional duration in seconds of the created token. When equal to None (the default) the created token won’t expire.

Returns

The URL template of the shared tiles.

Return type

url

Raises

UnsupportedResourceError – In case the dataset ingestion statuses aren’t equal to complete or a dataset type isn’t raster or vector with mapservice source, or dataset types are mixed.

update_properties(dataset, *, properties, **kwargs)

Update the dataset properties.

Parameters
  • dataset (str) – Identifier of the dataset whose properties to update.

  • properties (dict) – Dictionary of properties to update.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

upload_file(dataset, *, component, file_path, md5hash=None, multipart=True, chunk_size=None)

Upload a file to a dataset component.

By default, it uploads directly into the storage provider, by using signed URIs. If you want to use the legacy upload method (not recommended), then change alteia.core.resources.datamngt.uploader.USE_LEGACY_UPLOADER to True, or set env variable USE_LEGACY_UPLOADER=1 before running your script.

Parameters
  • dataset (str) – Identifier of the dataset to upload to.

  • component (str) – Name of component to upload to.

  • file_path (Union[str, Path]) – Path to the file to upload.

  • md5hash (Optional[str]) – Optional MD5 hash of the file to upload read in binary mode and containing only hexadecimal digits. Will be computed when equal to None (the default).

  • multipart (bool) – Whether to upload the file using multipart upload. Default to True unless the total number of part is < 2.

  • chunk_size (Optional[int]) – The size in byte of each part for a multipart upload. If file size is less than this number, multipart will not be used. The value is limited by storage provider and Data-Manager capabilities. 5MiB is the min value.

Features

class FeaturesImpl(features_service_api, **kwargs)
add_attachments(*, feature, attachments, **kwargs)

Add attachments to a feature

Parameters
  • feature (str) – Identifier of the feature.

  • attachments (List[str]) – List datasets.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

create(*, geometry=None, properties=None, collection=None, **kwargs)

Create a feature.

Parameters
  • geometry (Optional[dict]) – A dictionary following GeoJSON specification.

  • properties (Optional[dict]) – Dictionary of properties.

  • collection (Optional[str]) – Identifier of a collection to add the created feature to.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Resource

Returns

Resource for the created feature.

create_features(descriptions, **kwargs)

Create features.

Parameters
  • descriptions (Iterable[dict]) – List of features descriptions, each description is a dictionary with keys among arguments of create().

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

List[Resource]

Returns

List of resource for the created features.

delete(feature, *, permanent=False, **kwargs)

Delete a feature or multiple features.

Parameters
  • feature (Union[str, List[str]]) – Identifier of the feature to delete, or list of such identifiers.

  • permanent (bool) – Whether to delete features permanently or not. Default to False.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

delete_feature_properties(feature, properties)

Delete feature properties

Parameters
  • feature (str) – The feature id.

  • properties (List[str]) – List of properties to delete.

Return type

Resource

Returns

The updated feature resource.

delete_features_properties(features_properties)

Delete features properties

Parameters

features_properties (Dict[str, List[str]]) – The dictionary key is the feature ID and its value is the list of properties to remove.

Return type

List[Resource]

Returns

List of updated features resources.

describe(feature, **kwargs)

Describe a feature or a list of features.

Parameters
  • feature (Union[str, List[str]]) – Identifier of the feature to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[Resource, List[Resource]]

Returns

The feature description or a list of feature description.

remove_attachments(*, feature, attachments, **kwargs)

Remove attachments to a feature

Parameters
  • feature (str) – Identifier of the feature.

  • attachments (List[str]) – List datasets.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

restore(feature, **kwargs)

Restore a feature or multiple features.

Parameters
  • feature (Union[str, List[str]]) – Identifier of the feature to restore, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

search(*, filter=None, limit=None, page=None, sort=None, return_total=False, **kwargs)

Search features.

Parameters
  • filter (Optional[dict]) – Search filter dictionary (refer to /search-features definition in the Feature Service API for a detailed description of filter).

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 1).

  • sort (Optional[dict]) – Optional. Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[ResourcesWithTotal, List[Resource]]

Returns

A list of features descriptions OR a namedtuple with total number of results and list of features descriptions.

Examples

>>> sdk.features.search(filter={'collection': {'$eq': '5f5155ae8dcb064fcbf4ae35'}})
[Resource(_id='5f5155ae8dcb064fcbf4ae35'), ...]
>>> sdk.features.search(filter={'properties.name': {'$eq': 'Truck'}},
...                     return_total=True)
ResourcesWithTotal(
    total=...,
    results=[Resource(_id='5f5155ae8dcb064fcbf4ae35'), ...]
)
search_generator(*, filter=None, limit=50, page=None, **kwargs)

Return a generator to search through features.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found features are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • page (Optional[int]) – Optional page number to start the search at (default is 1).

  • filter (Optional[dict]) – Search filter dictionary.

  • limit (int) – Optional maximum number of results by search request (default to 50).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found features.

set_geometry(feature, *, geometry, **kwargs)

Set the geometry of the feature.

Parameters
  • feature (str) – Identifier of the feature whose geometry to set.

  • geometry (dict) – A dictionary following GeoJSON specification.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

update_feature_properties(feature, properties)

Update feature properties

Parameters
  • feature (str) – The feature id.

  • properties (Dict[str, Any]) – The dictionary of properties to update.

Return type

Resource

Returns

The updated feature resource.

update_features_properties(features_properties)

Update features properties

Parameters

features_properties (Dict[str, Dict]) – Map : featureId -> properties description.

Return type

List[Resource]

Returns

List of updated features resources.

Missions

class MissionsImpl(project_manager_api, **kwargs)
compute_bbox(mission, **kwargs)

Perform an automatic computation of the mission’s bbox.

Parameters
  • mission (str) – Identifier of the mission to update.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated mission resource.

Return type

Mission

create(*, project, survey_date, number_of_images, name=None, **kwargs)

Creates a mission.

Based on the number of images to attach to the mission, this function calls create_survey() or create_mission(). If you have images, you also have to send coordinates or geometry (not both).

Parameters
  • project (str) – Identifier of the project on which the mission is added.

  • survey_date (str) – Survey date of the mission (format: YYYY-MM-DDTHH:MM:SS.sssZ).

  • number_of_images (int) – Number of images that will be uploaded.

  • name (Optional[str]) – Optional mission name.

  • **kwargs – Optional arguments that will be merged into the mission description.

Returns

A tuple with the created flight and mission.

Flight = None when the number of images is 0.

Return type

Tuple[Flight, Mission]

create_archive(mission, *, name=None, chunk_size=None, **kwargs)

Request to create an archive of mission’s images.

Parameters
  • mission (str) – Identifier of the mission.

  • name (Optional[str]) – Optional name of the archive file.

  • chunk_size (Optional[int]) – Optional. Will create files with this maximum size (in MegaBytes). Refer to /create-mission-archive definition in the Project management API to have the default chunk value.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

bool

Returns

True if creation request is accepted, else False.

Examples

>>> sdk.missions.create_archive('5d6e0dcc965a0f56891f3861', chunk_size=2000)
True
>>> sdk.missions.create_archive('5d6e0dcc965a0f56891f3861', name='my custom archive')
True
create_mission(*, project, survey_date, name=None, **kwargs)

Creates a mission without images.

This function is used when no image is attached to the mission. As a consequence, no flight will be created.

Parameters
  • project (str) – Identifier of the project on which the mission is added.

  • survey_date (str) – Survey date of the mission (format: YYYY-MM-DDTHH:MM:SS.sssZ).

  • name (Optional[str]) – Optional mission name.

  • **kwargs – Optional arguments that will be merged into the mission description.

Returns

The created mission.

Return type

Mission

create_survey(*, survey_date, project, number_of_images, name=None, coordinates=None, geometry=None, area=0, **kwargs)

Create a survey (mission + flight).

This function is used when images will be attached to the mission. As a consequence, a flight will be created as well. The survey creation need the bounds of the mission. So, one of coordinates or geometry (not both) must be sent.

Parameters
  • survey_date (str) – Survey date (format: YYYY-MM-DDTHH:MM:SS.sssZ).

  • project (str) – Project identifier on which the survey is added.

  • number_of_images (int) – Number of photos that will be uploaded.

  • name (Optional[str]) – Optional mission name.

  • coordinates (Optional[List]) – Optional Coordinates bounding the mission to create. The last coordinate of the list should be the same as the first one. Do not use with geometry.

  • geometry (Optional[Dict]) – Optional Geometry bounding the mission to create. The geometry must be a type “GeometryCollection” with at least one “Polygon” inside. Do not use with coordinates.

  • area (float) – Optional survey area.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Raises

QueryError – The survey creation response is incorrect.

Returns

A tuple with the created flight and mission.

Return type

Tuple[Flight, Mission]

delete(mission)

Delete a mission.

Parameters

mission (str) – Identifier of the mission to delete.

describe(mission, **kwargs)

Describe a mission or a list of missions.

Parameters
  • mission (Union[str, List[str]]) – Identifier of the mission to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[Resource, List[Resource]]

Returns

The mission description or a list of mission descriptions.

search(*, filter=None, fields=None, limit=100, page=None, sort=None, return_total=False, **kwargs)

Search missions.

Parameters
  • filter (Optional[dict]) – Optional Search filter (refer to /search-missions definition in the Project management API for a detailed description of supported operators).

  • fields (Optional[dict]) – Optional Field names to include or exclude from the response. {"include: ["name", "creation_date"]} {"exclude: ["name", "creation_date"]} Do not use both include and exclude.

  • limit (int) – Optional Maximum number of results to extract (default is 100).

  • page (Optional[int]) – Optional Page number (starting at page 1).

  • sort (Optional[dict]) – Optional Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Resources: A list of resources OR a namedtuple

with total number of results and list of resources.

Examples

>>> # search missions with name exacty equals to 'my mission'
>>> sdk.missions.search(filter={'name': {'$eq': 'my mission'}})
[Resource(_id='5d6e0dcc965a0f56891f3861'), ...]
>>> # search missions having 'my' in their name (case-insensitive)
>>> sdk.missions.search(filter={'name': {'$match': 'my'}})
[Resource(_id='5d6e0dcc965a0f56891f3861'), ...]
>>> # search missions by IDs (should use missions.describe() instead)
>>> sdk.missions.search(filter={'_id': {'$eq': '5d6e0dcc965a0f56891f3861'}})
[Resource(_id='5d6e0dcc965a0f56891f3861'), ...]
>>> # search missions of a wanted project (could use '$in' with an array of IDs)
>>> sdk.projects.search(filter={'project': {'$eq': '41b9b3c7e6cd160006586688'}})
[Resource(_id='5d6e0dcc965a0f56891f3861'), ...]
>>> # search missions related to some flights
>>> sdk.projects.search(filter={
...     'flights': {'$in': ['628a73655029ff0006efe596', '628a73655029ff0006efe597'}
... })
[Resource(_id='5d6e0dcc965a0f56891f3860'), ...]
>>> # search missions updated after December 15th 2021
>>> sdk.missions.search(filter={'modification_date': {'$gt': '2021-12-15T00:00:00'}})
[Resource(_id='5d6e0dcc965a0f56891f3861'), ...]
>>> # search missions with a survey date between September and December 2021
>>> sdk.missions.search(filter={
...     'survey_date': {'$gte': '2021-09-01T00:00:00', '$lt': '2022-01-01T00:00:00'}
... })
[Resource(_id='5d6e0dcc965a0f56891f3861'), ...]
>>> # get second page of the same search
>>> sdk.missions.search(filter={...}, page=2)
[Resource(_id='60924899669e6e0007f8d262'), ...]
>>> # search 400 last created missions, in 2 calls (prefer search_generator() to get all)
>>> sdk.missions.search(sort={'creation_date': -1}, limit=200)
[Resource(_id='5d6e0dcc965a0f56891f3861'), ...]
>>> sdk.missions.search(sort={'creation_date': -1}, limit=200, page=2)
[Resource(_id='60924899669e6e0007f8d262'), ...]
>>> # search missions and also get the total results
>>> sdk.missions.search(filter={...}, return_total=True)
ResourcesWithTotal(total=612, results=[Resource(_id='5d6e0dcc965a0f56891f3861'), ...])
Return type

Union[ResourcesWithTotal, List[Resource]]

search_generator(*, filter=None, fields=None, limit=100, page=None, sort=None, **kwargs)

Return a generator to search through missions.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found missions are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • filter (Optional[dict]) – Optional filter dictionary from search() method.

  • fields (Optional[dict]) – Optional fields dictionary from search() method.

  • limit (int) – Optional maximum number of results by search request (default is 100).

  • page (Optional[int]) – Optional page number to start the search at (default is 1).

  • sort (Optional[dict]) – Optional sort dictionary from search() method.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found missions.

Examples

>>> # get all missions matching filter by using generator
>>> results_iterator = sdk.missions.search_generator(filter={...})
>>> missions = [r for r in results_iterator]
update_bbox(mission, *, real_bbox, **kwargs)

Update the mission real bbox.

Parameters
  • mission (str) – Identifier of the mission to update.

  • real_bbox (dict) – GeoJSON Geometry, needs type and coordinates, and an optional bbox with 4-numbers’s list ([minX, minY, maxX, maxY]).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated mission resource.

Return type

Mission

Examples

>>> sdk.missions.update_bbox('5d6e0dcc965a0f56891f3861', real_bbox={
...     'type': 'Polygon',
...     'coordinates': [[[112.5, 43.2], [112.6, 43.3], [112.7, 43.1], [112.5, 43.2]]],
... })
Mission(_id='5d6e0dcc965a0f56891f3861')
update_geometry(mission, *, geometry, **kwargs)

Update the mission geometry.

Parameters
  • mission (str) – Identifier of the mission to update.

  • geometry (dict) – GeoJSON Geometry format, needs type and coordinates.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated mission resource.

Return type

Mission

update_name(mission, *, name, **kwargs)

Update the mission name.

Parameters
  • mission (str) – Identifier of the mission to update.

  • name (str) – New mission name.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated mission resource.

Return type

Mission

update_survey_date(mission, *, survey_date, **kwargs)

Update the mission survey date.

Parameters
  • mission (str) – Identifier of the mission to update.

  • survey_date (str) – Survey date (format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS.sssZ).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated mission resource.

Return type

Mission

Examples

>>> sdk.missions.update_survey_date('5d6e0dcc965a0f56891f3861',
...                                 survey_date='2021-11-28')
Mission(_id='5d6e0dcc965a0f56891f3861')

Mission resource

class Mission(**kwargs)
__init__(**kwargs)

Mission resource.

Parameters
  • id – Mission identifier.

  • name – Mission name.

  • project – Project identifier.

  • survey_date – Survey date (format: YYYY-MM-DDTHH:MM:SS.sssZ).

  • flights – List of flight identifiers.

  • geometry – Mission geometry.

  • created – Mission creation date (format: YYYY-MM-DDTHH:MM:SS.sssZ).

  • user – Mission creation user.

  • modification_date – Mission last modification date (format: YYYY-MM-DDTHH:MM:SS.sssZ).

  • modification_user – Mission last modification user.

  • real_bbox – Mission bounding box.

Returns

A mission resource.

Return type

Mission

Flights

class FlightsImpl(project_manager_api, **kwargs)
describe(flight, **kwargs)

Describe a flight or a list of flights.

Parameters
  • flight (Union[str, List[str]]) – Identifier of the flight to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[Resource, List[Resource]]

Returns

The flight description or a list of flight descriptions.

describe_uploads_status(*, flights=None, missions=None, projects=None, limit=None, page=None, return_total=False, **kwargs)

Describe uncompleted flights status, descending sort by flight creation date.

Parameters
  • flights (Union[str, List[str], None]) – Optional Identifier of a flight or list of such identifiers.

  • missions (Union[str, List[str], None]) – Optional Identifier of a mission or list of such identifiers.

  • projects (Union[str, List[str], None]) – Optional Identifier of a project or list of such identifiers.

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 1).

  • return_total (bool) – Optional Return the number of results found, default False.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[ResourcesWithTotal, List[Resource]]

Returns

A list of flights OR a namedtuple with total number of results and list of flights.

search(*, filter=None, fields=None, limit=100, page=None, sort=None, return_total=False, **kwargs)

Search flights.

Parameters
  • filter (Optional[dict]) – Optional Search filter (refer to /search-flights definition in the Project management API for a detailed description of supported operators).

  • fields (Optional[dict]) – Optional Field names to include or exclude from the response. {"include: ["name", "creation_date"]} {"exclude: ["name", "creation_date"]} Do not use both include and exclude.

  • limit (int) – Optional Maximum number of results to extract (default is 100).

  • page (Optional[int]) – Optional Page number (starting at page 1).

  • sort (Optional[dict]) – Optional. Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Resources: A list of resources OR a namedtuple

with total number of results and list of resources.

Examples

>>> # search flights by IDs (should use flights.describe() instead)
>>> sdk.flights.search(filter={'_id': {'$eq': '5d6e0dcc965a0f56891f3865'}})
[Resource(_id='5d6e0dcc965a0f56891f3865'), ...]
>>> # search flights of a wanted project (could use '$in' with an array of IDs)
>>> sdk.flights.search(filter={'project': {'$eq': '41b9b3c7e6cd160006586688'}})
[Resource(_id='5d6e0dcc965a0f56891f3865'), ...]
>>> # search flights of wanted missions
>>> sdk.flights.search(filter={
...     'mission': {'$in': ['5d6e0dcc965a0f56891f3861', '60924899669e6e0007f8d262'}
... })
[Resource(_id='5d6e0dcc965a0f56891f3865'), ...]
>>> # search flights updated after December 15th 2021
>>> sdk.flights.search(filter={'modification_date': {'$gt': '2021-12-15T00:00:00'}})
[Resource(_id='5d6e0dcc965a0f56891f3865'), ...]
>>> # search flights having 1000+ photos
>>> sdk.flights.search(filter={'number_of_photos': {'$gte': 1000}})
[Resource(_id='5d6e0dcc965a0f56891f3865'), ...]
>>> # search uncompleted flights of wanted mission (prefer describe_uploads_status())
>>> sdk.flights.search(filter={
...     'status.name': {'$ne': 'completed'},
...     'mission': {'eq': '5d6e0dcc965a0f56891f3861'},
... })
[Resource(_id='5d6e0dcc965a0f56891f3865'), ...]
>>> # get second page of the same search
>>> sdk.flights.search(filter={...}, page=2)
[Resource(_id='60924899669e6e0007f8d266'), ...]
>>> # search 400 last created flights, in 2 calls (prefer search_generator() to get all)
>>> sdk.flights.search(sort={'creation_date': -1}, limit=200)
[Resource(_id='5d6e0dcc965a0f56891f3865'), ...]
>>> sdk.flights.search(sort={'creation_date': -1}, limit=200, page=2)
[Resource(_id='60924899669e6e0007f8d266'), ...]
>>> # search flights and also get the total results
>>> sdk.flights.search(filter={...}, return_total=True)
ResourcesWithTotal(total=612, results=[Resource(_id='5d6e0dcc965a0f56891f3865'), ...])
Return type

Union[ResourcesWithTotal, List[Resource]]

search_generator(*, filter=None, fields=None, limit=100, page=None, sort=None, **kwargs)

Return a generator to search through flights.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found flights are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • filter (Optional[dict]) – Optional filter dictionary from search() method.

  • fields (Optional[dict]) – Optional fields dictionary from search() method.

  • limit (int) – Optional maximum number of results by search request (default is 100).

  • page (Optional[int]) – Optional page number to start the search at (default is 1).

  • sort (Optional[dict]) – Optional sort dictionary from search() method.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found flights.

Examples

>>> # get all flights matching filter by using generator
>>> results_iterator = sdk.flights.search_generator(filter={...})
>>> flights = [r for r in results_iterator]
update_bbox(flight, *, real_bbox, **kwargs)

Update the flight real bbox.

Parameters
  • flight (str) – Identifier of the flight to update.

  • real_bbox (dict) – GeoJSON Geometry, needs type and coordinates, and an optional bbox with 4-numbers’s list ([minX, minY, maxX, maxY]).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated flight resource.

Return type

Flight

Examples

>>> sdk.flights.update_bbox('5d6e0dcc965a0f56891f3865', real_bbox={
...     'type': 'Polygon',
...     'coordinates': [[[112.5, 43.2], [112.6, 43.3], [112.7, 43.1], [112.5, 43.2]]],
... })
Flight(_id='5d6e0dcc965a0f56891f3865')
update_geodata(flight, *, bbox=None, geometry=None, **kwargs)

Update the flight geo data (bbox and geometry).

Parameters
  • flight (str) – Identifier of the flight to update.

  • bbox (Optional[list]) – Optional 4-numbers’s list ([minX, minY, maxX, maxY]).

  • geometry (Optional[dict]) – Optional GeoJSON Geometry, needs type and coordinates.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated flight resource.

Return type

Flight

update_name(flight, *, name, **kwargs)

Update the flight name.

Parameters
  • flight (str) – Identifier of the flight to update.

  • name (str) – New flight name.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated flight resource.

Return type

Flight

update_status(flight, *, status, **kwargs)

Update the flight status.

Parameters
  • flight (str) – Identifier of the flight to update.

  • status (str) – Upload status (one of: flying, uploading, temporary-blocked, error, completed).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated flight resource.

Return type

Flight

update_survey_date(flight, *, survey_date, **kwargs)

Update the flight survey date.

Parameters
  • flight (str) – Identifier of the flight to update.

  • survey_date (str) – Survey date (format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS.sssZ).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated flight resource.

Return type

Flight

Examples

>>> sdk.flights.update_survey_date('5d6e0dcc965a0f56891f3865',
...                                survey_date='2021-11-28')
Flight(_id='5d6e0dcc965a0f56891f3865')

Flight resource

class Flight(**kwargs)
__init__(**kwargs)

Flight resource.

Parameters
  • id – Flight identifier.

  • name – Flight name.

  • survey_date – Survey date (format: YYYY-MM-DDTHH:MM:SS.sssZ).

  • project – Project identifier.

  • mission – Mission identifier.

  • number_of_photos – Number of images in the flight.

  • created – Flight creation date.

  • user – Flight creation user.

Returns

A flight resource.

Return type

Flight

Products

class ProductsImpl(analytics_service_api, **kwargs)
cancel(product)

Cancel a running Analytics product.

Parameters

product (str) – Identifier of the product to cancel.

Return type

Resource

Returns

The product description.

Raises

ResponseError – When the product identifier is incorrect or has not been found.

describe(product, **kwargs)

Describe an Analytics product.

Parameters
  • product (str) – Identifier of the product to describe.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Resource

Returns

The product description.

Raises

ResponseError – When the product identifier is incorrect or has not been found.

follow_logs(product, **kwargs)

Follow logs for a product through a generator.

The function returns when the product status is either available,

failed or rejected.

Parameters
  • product (str) – Identifier of the product.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[ProductLog, None, None]

Returns

A generator yielding each log entry chronologically.

retrieve_logs(product, **kwargs)

Retrieve logs for a product (sorted chronogically).

Parameters
  • product (str) – Identifier of the product.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A namedtuple with total number of log entries

and the list of product logs.

Return type

Logs

search(*, project=None, filter=None, limit=None, page=None, sort=None, return_total=False, **kwargs)

Search for Analytics products.

Parameters
  • project (Optional[str]) – Optional Project identifier.

  • filter (Optional[Dict]) – Search filter dictionary (refer to /search-products definition in the Analytics-service API for a detailed description of filter).

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 0).

  • sort (Optional[dict]) – Optional. Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A list of product resources OR a namedtuple

with total number of results and list of product resources.

Return type

Products

search_generator(*, filter=None, limit=50, page=None, **kwargs)

Return a generator to search through products.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found products are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • page (Optional[int]) – Optional page number to start the search at (default is 0).

  • filter (Optional[dict]) – Search filter dictionary.

  • limit (int) – Optional maximum number of results by search request (default to 50).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found products.

Projects

class ProjectsImpl(project_manager_api, **kwargs)
compute_bbox(project, **kwargs)

Perform an automatic computation of the project’s bbox.

Parameters
  • project (str) – Identifier of the project to update.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated project resource.

Return type

Project

create(name, company, geometry=None, **kwargs)

Create a project.

Parameters
  • name (str) – Project name.

  • company (str) – Company identifier.

  • geometry (Optional[dict]) – Optional project geometry.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Raises

QueryError – The project creation response is incorrect.

Returns

A resource encapsulating the created project.

Return type

Project

delete(project)

Delete the specified Project.

Parameters

project (str) – Identifier of the project to delete.

Return type

None

describe(project, **kwargs)

Describe a project or a list of projects.

Parameters
  • project (Union[str, List[str]]) – Identifier of the project to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[Resource, List[Resource]]

Returns

The project description or a list of project descriptions.

search(*, filter=None, fields=None, limit=100, page=None, sort=None, return_total=False, **kwargs)

Search projects.

Parameters
  • filter (Optional[dict]) – Optional Search filter (refer to /search-projects definition in the Project management API for a detailed description of supported operators).

  • fields (Optional[dict]) – Optional Field names to include or exclude from the response. {"include: ["name", "creation_date"]} {"exclude: ["name", "creation_date"]} Do not use both include and exclude.

  • limit (int) – Optional Maximum number of results to extract (default is 100).

  • page (Optional[int]) – Optional Page number (starting at page 1).

  • sort (Optional[dict]) – Optional Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Resources: A list of resources OR a namedtuple

with total number of results and list of resources.

Examples

>>> # search projects with name exacty equals to 'my project'
>>> sdk.projects.search(filter={'name': {'$eq': 'my project'}})
[Resource(_id='5d6e0dcc965a0f56891f3860'), ...]
>>> # search projects having 'my' in their name (case-insensitive)
>>> sdk.projects.search(filter={'name': {'$match': 'my'}})
[Resource(_id='5d6e0dcc965a0f56891f3860'), ...]
>>> # search projects having 'my' in their name or place name or tags (case-insensitive)
>>> sdk.projects.search(filter={'search': {'$match': 'my'}})
[Resource(_id='5d6e0dcc965a0f56891f3860'), ...]
>>> # search projects by IDs (should use projects.describe() instead)
>>> sdk.projects.search(filter={'_id': {'$eq': '5d6e0dcc965a0f56891f3860'}})
[Resource(_id='5d6e0dcc965a0f56891f3860'), ...]
>>> # search projects of a wanted company (could use '$in' with an array of IDs)
>>> sdk.projects.search(filter={'company': {'$eq': '41b9b3c7e6cd160006586688'}})
[Resource(_id='5d6e0dcc965a0f56891f3860'), ...]
>>> # search projects updated after December 15th 2021
>>> sdk.projects.search(filter={'modification_date': {'$gt': '2021-12-15T00:00:00'}})
[Resource(_id='5d6e0dcc965a0f56891f3860'), ...]
>>> # get second page of the same search
>>> sdk.projects.search(filter={...}, page=2)
[Resource(_id='60924899669e6e0007f8d261'), ...]
>>> # search 400 first projects sorted by name ascending, in 2 calls
>>> sdk.projects.search(sort={'name': 1}, limit=200)
[Resource(_id='5d6e0dcc965a0f56891f3860'), ...]
>>> sdk.projects.search(sort={'name': 1}, limit=200, page=2)
[Resource(_id='60924899669e6e0007f8d261'), ...]
>>> # search projects and also get the total results
>>> sdk.projects.search(filter={...}, return_total=True)
ResourcesWithTotal(total=940, results=[Resource(_id='5d6e0dcc965a0f56891f3860'), ...])
Return type

Union[ResourcesWithTotal, List[Resource]]

search_generator(*, filter=None, fields=None, limit=100, page=None, sort=None, **kwargs)

Return a generator to search through projects.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found projects are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • filter (Optional[dict]) – Optional filter dictionary from search() method.

  • fields (Optional[dict]) – Optional fields dictionary from search() method.

  • limit (int) – Optional maximum number of results by search request (default is 100).

  • page (Optional[int]) – Optional page number to start the search at (default is 1).

  • sort (Optional[dict]) – Optional sort dictionary from search() method.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found projects.

Examples

>>> # get all projects matching filter by using generator
>>> results_iterator = sdk.projects.search_generator(filter={...})
>>> projects = [r for r in results_iterator]
update_bbox(project, *, real_bbox, **kwargs)

Update the project real bbox.

Parameters
  • project (str) – Identifier of the project to update.

  • real_bbox (dict) – GeoJSON Geometry, needs type and coordinates, and an optional bbox with 4-numbers’s list ([minX, minY, maxX, maxY]).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated project resource.

Return type

Project

Examples

>>> sdk.projects.update_bbox('5d6e0dcc965a0f56891f3860', real_bbox={
...     'type': 'Polygon',
...     'coordinates': [[[112.5, 43.2], [112.6, 43.3], [112.7, 43.1], [112.5, 43.2]]],
... })
Project(_id='5d6e0dcc965a0f56891f3860')
update_geometry(project, *, geometry, **kwargs)

Update the project geometry.

Parameters
  • project (str) – Identifier of the project to update.

  • geometry (dict) – GeoJSON Geometry format, needs type and coordinates.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated project resource.

Return type

Project

update_local_coordinates_dataset(project, *, dataset, **kwargs)

Update the local coordinates dataset of a project.

Parameters
  • project (str) – Identifier of the project to update.

  • dataset (str) – Dataset identifier of the local coordinates file.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated project resource.

Return type

Project

update_location(project, *, location=None, fixed=None, **kwargs)

Update the project’s location, set if the project’s location is fixed. Or both updates.

Parameters
  • project (str) – Identifier of the project to update.

  • location (Optional[List[float]]) – Optional Location in WGS84: (format: [Longitude, Latitude]). None to not change this parameter.

  • fixed (Optional[bool]) – Optional Flag to indicate if the location value will be fixed or not. True if you want to fix the position. False to let the location automatically updated in the future. None to not change this parameter. Default: None.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated project resource.

Return type

Project

Examples

>>> # fix a location of a project. It will not change automatically.
>>> sdk.projects.update_location('5d6e0dcc965a0f56891f3861',
...                              location=[-118.254, 46.95],
...                              fixed=True)
Project(_id='5d6e0dcc965a0f56891f3861')
>>> # Remove fixed location of a project. It will change automatically.
>>> sdk.projects.update_location('3037636c9a416900074ac253',
...                              fixed=None)
Project(_id='3037636c9a416900074ac253')
update_name(project, *, name, **kwargs)

Update the project name.

Parameters
  • project (str) – Identifier of the project to update.

  • name (str) – New project name.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated project resource.

Return type

Project

update_srs(project, *, horizontal_srs_wkt=None, vertical_srs_wkt=None, **kwargs)

Update the SRS of a project. Horizontal or Vertical or both.

Parameters
  • project (str) – Identifier of the project to update.

  • horizontal_srs_wkt (Optional[str]) – Optional WKT of horizontal SRS.

  • vertical_srs_wkt (Optional[str]) – Optional WKT of vertical SRS.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated project resource.

Return type

Project

update_status(project, status)

Update the project status.

Parameters
  • project (str) – Identifier of the project to update.

  • status (str) – Project status (pending, available, failed, maintenance).

Raises
  • ResponseError – When the project has not been found.

  • RuntimeError – The passed status is not allowed.

Returns

Updated project resource.

Return type

Project

update_units(project, *, units, **kwargs)

Update the units of a project.

Parameters
  • project (str) – Identifier of the project to update.

  • units (dict) – Dictionary of different types of units (“distances”, “surfaces”, “volumes”, “altitude”, “gsd”, “weight”, “slope”).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

Updated project resource.

Return type

Project

Examples

>>> sdk.projects.update_units('3037636c9a416900074ac253', units={
...     'distances': 'feet',
...     'surfaces': 'square-feet',
...     'volumes': 'cubic-feet',
...     'altitude': 'feet',
...     'gsd': 'inch/pixel',
...     'weight': 'metric-tons',
...     'slope': 'percent',
... })
Project(_id='3037636c9a416900074ac253')

Project resource

class Project(**kwargs)
__init__(**kwargs)

Project resource.

Parameters
  • id – Project identifier.

  • name – Project name.

  • geometry – Project geometry.

  • industry – Project industry.

  • created – Project creation date (format: YYYY-MM-DDTHH:MM:SS.sssZ).

  • company – Project’s company identifier.

  • missions – Project’s mission identifiers.

  • user – Project creation user.

  • modification_date – Project last modification date (format: YYYY-MM-DDTHH:MM:SS.sssZ).

  • modification_user – Project last modification user.

  • real_bbox – Project bounding box.

  • place_name – Project place name.

Returns

A project resource.

Return type

Project

Share tokens

class ShareTokensImpl(auth_api, sdk, **kwargs)
create(dataset, *, duration=None, **kwargs)

Create a share token for a given dataset.

Share token creation is restricted to users with admin profile or a manager role on their company.

When sharing multiple datasets, all datasets are expected to belong to a single company.

Parameters
  • dataset (Union[str, List[str]]) – Dataset identifier or list of dataset identifiers to create a share token for.

  • duration (Optional[int]) – Optional duration in seconds of the created token. When equal to None (the default) the created token won’t expire.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Resource

Returns

Dictionary with token, expiration_date and scope keys.

Example

>>> desc = sdk.share_tokens.create('5d08ebe86a17271b23bc0fcd')
>>> desc.token[:16]
'YfkX6oB5JB02L9x5'
revoke(token, **kwargs)

Revoke a share token.

Share token revocation is restricted to users with admin profile or a manager role on their company.

Parameters
  • token (str) – Token to revoke.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

search(*, filter=None, limit=None, page=None, return_total=False, **kwargs)

Search share tokens.

Share token search is restricted to users with admin profile or a manager role on their company.

Parameters
  • filter (Optional[dict]) – Search filter (refer to /search-share-tokens definition in the Authentication API specification for a detailed description of supported operators).

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 1).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

Return type

Union[ResourcesWithTotal, List[Resource]]

Returns

List of share token resources (with token, expiration_date and scope keys) or a namedtuple with total number of results and the list of resources.

search_generator(*, filter=None, limit=50, page=None, **kwargs)

Return a generator to search through share tokens.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found share tokens are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • page (Optional[int]) – Optional page number to start the search at (default is 1).

  • filter (Optional[dict]) – Search filter dictionary.

  • limit (int) – Optional maximum number of results by search request (default to 50).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found share tokens.

Tags

class TagsImpl(project_manager_api, sdk, **kwargs)
create(name, *, project, type, target=None, flight=None, **kwargs)

Create a tag.

Parameters
  • name (str) – Tag name.

  • project (str) – Identifier of project to tag.

  • type (str) – Tag type (must be one of project, annotation, flight, photo, dataset, feature, gcp, task).

  • target (Optional[str]) – Optional identifier of the target.

  • flight (Optional[str]) – Optional identifier of the flight (mandatory when the tag type is photo).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

The created tag.

Return type

Tag

Examples

>>> sdk.tags.create(
...    name='my tag',
...    project='5d63cf972fb3880011e57f22',
...    type='dataset',
...    target='5d63cf972fb3880011e57e34')
Tag(_id='5f6155ae8dcb064fcbf4ae35')
delete(tag)

Delete a tag.

Parameters
  • tag (str) – Identifier of the tag to delete.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Examples

>>> sdk.tags.delete('5d63cf972fb3880011e57f22')
Return type

None

search(*, project, type=None, target=None, flight=None, **kwargs)

Search tags.

When searching for tags on a photo. Both the flight id and target id must be supplied.

Parameters
  • project (str) – Identifier of the project.

  • type (Optional[str]) – Optional tag type (must be one of project, annotation, flight, photo, dataset, feature, gcp, task).

  • target (Optional[str]) – Optional identifier of the target.

  • flight (Optional[str]) – Optional identifier of the flight (mandatory when the tag type is photo).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

The found tags.

Return type

Resources

Examples

>>> sdk.tags.search(project='5d63cf972fb3880011e57f22')
[Tag(_id='5f6155ae8dcb064fcbf4ae35'), ...]

Teams

class TeamsImpl(asset_management_api, **kwargs)
create(*, company, name, leader=None, **kwargs)

Create a team.

Parameters
  • company (str) – Identifier of the company.

  • name (str) – Team name.

  • leader (Optional[str]) – Optional team leader (pilot id).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A team resource.

Return type

Resource

delete(team, **kwargs)

Delete a team.

Parameters
  • team (str) – Identifier of the team to delete.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

None

describe(team, **kwargs)

Describe a team or list of teams.

Parameters
  • team (Union[str, List[str]]) – Identifier of the team to describe, or list of such identifiers.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A team resource or a list of team resources.

Return type

Resource

rename(team, name, **kwargs)

Rename a team.

Parameters
  • team (str) – Identifier of the team.

  • name (str) – New name.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

The updated team resource.

Return type

Resource

search(*, filter=None, limit=None, page=None, sort=None, **kwargs)

Search teams.

Parameters
  • filter (Optional[dict]) – Search filter dictionary.

  • limit (Optional[int]) – Maximum number of results to extract.

  • page (Optional[int]) – Page number (starting at page 0).

  • sort (Optional[dict]) – Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A list of team resources.

Return type

Resources

set_leader(team, *, leader, **kwargs)

Set the team leader.

Parameters
  • team (str) – Identifier of the team.

  • leader (str) – Identifier of the pilot to promote to leader.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

The updated team resource.

Return type

Resource

Users

class UsersImpl(auth_api, **kwargs)
describe(user=None, **kwargs)

Describe a user.

Parameters
  • user (Optional[str]) – User identifier to describe.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

User resource.

Return type

User

search(*, filter=None, limit=None, page=None, sort=None, return_total=False, **kwargs)

Search users.

Parameters
  • filter (Optional[dict]) – Search filter (refer to /search-users definition in the User and company management API for a detailed description of supported operators).

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 1).

  • sort (Optional[dict]) – Optional. Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Returns

A list of resources OR a namedtuple

with total number of results and list of resources.

Return type

Resources

search_generator(*, filter=None, limit=50, page=None, **kwargs)

Return a generator to search through users.

The generator allows the user not to care about the pagination of results, while being memory-effective.

Found users are sorted chronologically in order to allow new resources to be found during the search.

Parameters
  • page (Optional[int]) – Optional page number to start the search at (default is 1).

  • filter (Optional[dict]) – Search filter dictionary.

  • limit (int) – Optional maximum number of results by search request (default to 50).

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Generator[Resource, None, None]

Returns

A generator yielding found users.

Datastream template

class DatastreamTemplateImpl(dataflow_service_api, **kwargs)
create(*, name, source, import_dataset, **kwargs)

Create a datastream template.

Parameters
  • name (str) – Datastream template name.

  • source (Dict) – Storage source.

  • import_dataset (Dict) –

    dataset parameter, information for the creating of dataset.

    type: dataset type(pcl, file, image, raster, maesh, vector)

    categories: Sequence of categories or None if there’s no

    category to set on the dataset.

    horizontal_srs_wkt: Optional geographic coordinate system

    for horizontal coordinattes in WKT format.

    ingestion: ingestion parameters

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Resource

Returns

The created datastream template description.

Examples

>>> sdk.datastreamtemplates.create(
...     name="My datastream template",
...     source= {"type":"object-storage"},
...     import_dataset= {"dataset_parameters":
...         {
...             "type": "pcl",
...             "categories": [],
...             "horizontal_srs_wkt": 'PROJCS["WGS 84 / UTM zone 31N",GEOGCS["WGS 84",
...                                           DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,
...                                           AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],
...                                           PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],
...                                           UNIT["degree",0.0174532925199433,
...                                           AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],
...                                           PROJECTION["Transverse_Mercator"],
...                                           PARAMETER["latitude_of_origin",0],
...                                           PARAMETER["central_meridian",3],
...                                           PARAMETER["scale_factor",0.9996],
...                                           PARAMETER["false_easting",500000],
...                                           PARAMETER["false_northing",0],
...                                           UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],
...                                           AXIS["Northing",NORTH],AUTHORITY["EPSG","32631"]]',
...             "ingestion": {"parameters": {"compute_boundary": True}},
...         }
...     },
...     contextualisation= {
...         "type": "geographic",
...         "parameters": {
...             "assets_schema_repository": "My Asset Repository",
...             "geographic_buffer": 50,
...             "schemas": [
...                 {
...                     "assets_schema": "My_asset",
...                     "assets_schema_property_name": "My asset property,
...                     "geographic_buffer": 150,
...                 }
...             ],
...         },
...     },
...     transform= {
...         "analytic": {
...             "name": "datastream",
...             "version_range": "XXX YYY",
...             "inputs_mapping": {},
...             "parameters": {},
...             "outputs_mapping": "",
...         },
...      },
...     "aggregate": {"type": "", "parameters": {}, "strategy": {}},
...     "company": "XXX"
...     "description": "My datastream description",
... )
Resource(_id='5e5155ae8dcb064fcbf4ae35')
delete(template)

Delete a datastream template entry.

Parameters

template (str) – datastream template identifier.

Return type

None

describe(*, template)

Describe a datastream template.

Parameters

templates – Identifier of the datastream template to describe.

Return type

Resource

Returns

The datastream template description.

describes(*, templates)

Describe datastream templates.

Parameters

templates (List[str]) – List of such identifiers.

Return type

List[Resource]

Returns

A list of datastream template description.

search(*, filter=None, limit=None, page=None, sort=None, exclude=None, return_total=False, **kwargs)

Search for a list of datastream templates.

Parameters
  • company – Company id.

  • filter (Optional[Dict]) – Search filter dictionary (refer to /search-datastream-templates definition in the Datastream Service API for a detailed description of filter).

  • limit (Optional[int]) – Optional Maximum number of results to extract.

  • page (Optional[int]) – Optional Page number (starting at page 0).

  • sort (Optional[dict]) – Optional Sort the results on the specified attributes (1 is sorting in ascending order, -1 is sorting in descending order).

  • exclude (Optional[List[str]]) – The properties to exclude from the response

  • return_total (bool) – Optional. Change the type of return: If False (default), the method will return a limited list of resources (limited by limit value). If True, the method will return a namedtuple with the total number of all results, and the limited list of resources.

  • **kwargs – Optional keyword arguments. Those arguments are passed as is to the API provider.

Return type

Union[ResourcesWithTotal, List[Resource]]

Returns

A list of datastream template resources OR a namedtuple

with total number of results and list of datastream template resources.

Datastream