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)[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. Wehn a license is associated to a metadata, it become 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."
    )
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.

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
delete(workgroup_id: str, license_id: str)[source]

Delete a license from Isogeo database.

Parameters:
  • workgroup_id (str) – identifier of the owner workgroup
  • license_id (str) – identifier of the resource to delete
dissociate_metadata(metadata: isogeo_pysdk.models.metadata.Metadata, condition_id: str) → requests.models.Response[source]

Removes the association between a metadata and a license.

If the specified license is not associated, the response is 404.

Parameters:
  • metadata (Metadata) – metadata object to update
  • license (License) – license model object to associate
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: list = ['_abilities', 'count'], caching: bool = 1) → list[source]

Get workgroup licenses.

Parameters:
  • workgroup_id (str) – identifier of the owner workgroup
  • include (list) – 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.

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