isogeo_pysdk.api.routes_specification module

Isogeo API v1 - API Routes for Specifications entities

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

class isogeo_pysdk.api.routes_specification.ApiSpecification(api_client=None)[source]

Bases: object

Routes as methods of Isogeo API used to manipulate specifications.

associate_metadata(metadata: isogeo_pysdk.models.metadata.Metadata, specification: isogeo_pysdk.models.specification.Specification, conformity: bool = 0) → requests.models.Response[source]

Associate a specification (specification + conformity) to a metadata. When a specification is associated to a metadata, it becomes a ResourceConformity object.

If the specified specification is already associated, the API responses is still a 200.

Parameters:
  • metadata (Metadata) – metadata object to update
  • specification (Specification) – specification model object to associate
  • conformity (bool) – indicates whether the dataset is compliant
Example:
>>> # retrieve objects to be associated
>>> md = isogeo.metadata.get(
        metadata_id=my_metadata_uuid,
        include=['specifications']
    )
>>> spec = isogeo.specification.get(my_specification_uuid)
>>> # associate them
>>> isogeo.specification.associate_metadata(
        metadata=md,
        specification=spec,
        conformity=1
    )
create(workgroup_id: str, check_exists: int = 1, specification: object = {'_abilities': None, '_id': None, '_tag': None, 'count': None, 'link': None, 'name': None, 'owner': None, 'published': None}) → isogeo_pysdk.models.specification.Specification[source]

Add a new specification to a workgroup.

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

Delete a specification from Isogeo database.

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

Removes the association between a metadata and a specification.

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

Parameters:
  • metadata (Metadata) – metadata object to update
  • specification_id (Specification) – specification model object to associate
exists(specification_id: str) → bool[source]

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

Parameters:specification_id (str) – identifier of the specification to verify
get(specification_id: str) → isogeo_pysdk.models.specification.Specification[source]

Get a specification.

Parameters:specification_id (str) – specification UUID
listing[source]

Get workgroup specifications.

Parameters:
  • workgroup_id (str) – identifier of the owner workgroup
  • include (tuple) – additional parts of model to include in response
  • caching (bool) – option to cache the response
update(specification: isogeo_pysdk.models.specification.Specification, caching: bool = 1) → isogeo_pysdk.models.specification.Specification[source]

Update a specification owned by a workgroup.

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