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)

Bases: object

Routes as methods of Isogeo API used to manipulate specifications.

associate_metadata(metadata, specification, conformity=0)

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
    )
Return type

Response

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

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

  • caching (bool) – option to cache the response

Return type

Specification

delete(workgroup_id, specification_id)

Delete a specification from Isogeo database.

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

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

Return type

dict

dissociate_metadata(metadata, specification_id)

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

Return type

Response

exists(specification_id)

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

Parameters

specification_id (str) – identifier of the specification to verify

Return type

bool

get(specification_id)

Get a specification.

Parameters

specification_id (str) – specification UUID

Return type

Specification

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

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

Return type

list

update(specification, caching=1)

Update a specification owned by a workgroup.

Parameters
  • specification (class) – Specification model object to update

  • caching (bool) – option to cache the response

Return type

Specification