isogeo_pysdk.api.routes_license module

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

See: http://help.isogeo.com/api/complete/index.html

class isogeo_pysdk.api.routes_license.ApiLicense(api_client=None)

Bases: object

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

associate_metadata(metadata, license, description, force=0)

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.

Parameters
  • 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

Example

>>> # retrieve objects to be associated
>>> md = isogeo.metadata.get(
        metadata_id="6b5cc93626634d0e9b0d2c48eff96bc3",
        include=['conditions']
    )
>>> lic = isogeo.license.license("f6e0c665905a4feab1e9c1d6359a225f")
>>> # associate them
>>> isogeo.license.associate_metadata(
        metadata=md,
        license=lic,
        description="Specific description for this license when applied to this metadata."
    )
Return type

Response

create(workgroup_id, check_exists=1, license={'_abilities': None, '_id': None, '_tag': None, 'content': None, 'count': None, 'link': None, 'name': None, 'owner': None})

Add a new license to a workgroup.

Parameters
  • 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

Return type

License

delete(workgroup_id, license_id)

Delete a license from Isogeo database.

Parameters
  • workgroup_id (str) – identifier of the owner workgroup

  • license_id (str) – identifier of the resource to delete

exists(license_id)

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

Parameters

license_id (str) – identifier of the license to verify

Return type

bool

get(license_id)

Get details about a specific license.

Parameters

license_id (str) – license UUID

Return type

License

listing(workgroup_id=None, include=('_abilities', 'count'), caching=1)

Get workgroup licenses.

Parameters
  • workgroup_id (str) – identifier of the owner workgroup

  • include (tuple) – additionnal subresource to include in the response

  • caching (bool) – option to cache the response

Return type

list

update(license, caching=1)

Update a license owned by a workgroup.

Parameters
  • license (class) – License model object to update

  • caching (bool) – option to cache the response

Return type

License