isogeo_pysdk.api.routes_limitation module

Isogeo API v1 - API Routes to manage metadata limitations.

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

class isogeo_pysdk.api.routes_limitation.ApiLimitation(api_client=None)[source]

Bases: object

Routes as methods of Isogeo API used to manipulate metadata limitations (CGUs).

create(metadata: isogeo_pysdk.models.metadata.Metadata, limitation: isogeo_pysdk.models.limitation.Limitation) → isogeo_pysdk.models.limitation.Limitation[source]

Add a new limitation to a metadata (= resource).

Parameters:
  • metadata (Metadata) – metadata (resource) to edit
  • limitation (Limitation) – limitation object to create
Returns:

409 if a limitation with the same name already exists.

Return type:

Limitation or tuple

Example:
>>> # retrieve metadata
>>> md = isogeo.metadata.get(METADATA_UUID)
>>> # create the limitation locally
>>> new_limitation = Limitation(
    type="legal",
    restriction="patent",
    description="Do not use for commercial purpose.",
    )
>>> # add it to the metadata
>>> isogeo.metadata.limitations.create(md, new_limitation)
delete(limitation: isogeo_pysdk.models.limitation.Limitation, metadata: isogeo_pysdk.models.metadata.Metadata = None)[source]

Delete a limitation from a metadata.

Parameters:
  • limitation (Limitation) – Limitation model object to delete
  • metadata (Metadata) – parent metadata (resource) containing the limitation
get(metadata_id: str, limitation_id: str) → isogeo_pysdk.models.limitation.Limitation[source]

Get details about a specific limitation.

Parameters:
  • metadata_id (str) – metadata UUID
  • limitation_id (str) – limitation UUID
Example:
>>> # get a metadata
>>> md = isogeo.metadata.get(METADATA_UUID)
>>> # list its limitations
>>> md_limitations = isogeo.metadata.limitations.listing(md)
>>> # get the first limitation
>>> limitation = isogeo.metadata.limitations.get(
    metadata_id=md._id,
    limitation_id=md_limitations[0].get("_id")
    )
listing(metadata: isogeo_pysdk.models.metadata.Metadata) → list[source]

Get limitations of a metadata.

Parameters:metadata (Metadata) – metadata (resource)
update(limitation: isogeo_pysdk.models.limitation.Limitation, metadata: isogeo_pysdk.models.metadata.Metadata = None) → isogeo_pysdk.models.limitation.Limitation[source]

Update a limitation.

Parameters:
  • limitation (Limitation) – Limitation model object to update
  • metadata (Metadata) – parent metadata (resource) containing the limitation