isogeo_pysdk.api.routes_license module

Isogeo API v1 - API Routes for Licenses (= CGUs, conditions) entities


class isogeo_pysdk.api.routes_license.ApiLicense(api_client=None)[source]

Bases: object

Routes as methods of Isogeo API used to manipulate licenses (conditions).

associate_metadata(metadata: isogeo_pysdk.models.metadata.Metadata, license: isogeo_pysdk.models.license.License, description: str, force: bool = 0) → requests.models.Response[source]

Associate a condition (license + specific description) to a metadata. When a license is associated to a metadata, it becomes a condition.

By default, if the specified license is already associated, the method won’t duplicate the association. Use force option to overpass this behavior.

  • metadata (Metadata) – metadata object to update
  • license (License) – license model object to associate
  • description (str) – additional description to add to the association. Optional.
  • force (bool) – force association even if the same license is already associated
>>> # retrieve objects to be associated
>>> md = isogeo.metadata.get(
>>> lic = isogeo.license.license("f6e0c665905a4feab1e9c1d6359a225f")
>>> # associate them
>>> isogeo.license.associate_metadata(
        description="Specific description for this license when applied to this metadata."
create(workgroup_id: str, check_exists: int = 1, license: object = {'_abilities': None, '_id': None, '_tag': None, 'content': None, 'count': None, 'link': None, 'name': None, 'owner': None}) → isogeo_pysdk.models.license.License[source]

Add a new license to a workgroup.

  • workgroup_id (str) – identifier of the owner workgroup
  • check_exists (int) – check if a license already exists inot the workgroup:
  • 0 = no check
  • 1 = compare name [DEFAULT]
Parameters:license (class) – License model object to create
delete(workgroup_id: str, license_id: str)[source]

Delete a license from Isogeo database.

  • workgroup_id (str) – identifier of the owner workgroup
  • license_id (str) – identifier of the resource to delete
exists(license_id: str) → bool[source]

Check if the specified license exists and is available for the authenticated user.

Parameters:license_id (str) – identifier of the license to verify
get(license_id: str) → isogeo_pysdk.models.license.License[source]

Get details about a specific license.

Parameters:license_id (str) – license UUID
listing(workgroup_id: str = None, include: tuple = ('_abilities', 'count'), caching: bool = 1) → list[source]

Get workgroup licenses.

  • workgroup_id (str) – identifier of the owner workgroup
  • include (tuple) – additionnal subresource to include in the response
  • caching (bool) – option to cache the response
update(license: isogeo_pysdk.models.license.License, caching: bool = 1) → isogeo_pysdk.models.license.License[source]

Update a license owned by a workgroup.

  • license (class) – License model object to update
  • caching (bool) – option to cache the response