isogeo_pysdk.api.routes_metadata module

Isogeo API v1 - API Routes for Resources (= Metadata) entity


class isogeo_pysdk.api.routes_metadata.ApiMetadata(api_client=None)[source]

Bases: object

Routes as methods of Isogeo API used to manipulate metadatas (resources).


Returns asssociated catalogs with a metadata. Just a shortcut.

Parameters:metadata (Metadata) – metadata object
Return type:list
create(workgroup_id: str, metadata: isogeo_pysdk.models.metadata.Metadata, check_exists: bool = 1, return_basic_or_complete: bool = 0) → isogeo_pysdk.models.metadata.Metadata[source]

Add a new metadata to a workgroup.

  • workgroup_id (str) – identifier of the owner workgroup
  • metadata (Metadata) – Metadata model object to create
  • check_exists (bool) –

    check if a metadata with the same title already exists into the workgroup:

    • 0 = no check
    • 1 = compare name [DEFAULT]
  • return_basic_or_complete (bool) –

    creation of metada uses a bulk script. So, by default API does not return the complete object but the minimal info. This option allow to overrides the basic behavior. Options:

    • 0 = basic (only the _id, title and attributes passed for the creation) [DEFAULT]
    • 1 = complete (make an addtionnal request)
Return type:


delete(metadata_id: str) → requests.models.Response[source]

Delete a metadata from Isogeo database.

Parameters:metadata_id (str) – identifier of the resource to delete
download_xml(metadata: isogeo_pysdk.models.metadata.Metadata) → requests.models.Response[source]

Download the metadata exported into XML ISO 19139.

Parameters:metadata (Metadata) – metadata object to export
Return type:Response
# get the download stream
xml_stream = isogeo.metadata.download_xml(Metadata(_id=METADATA_UUID))
# write it to a file
with open("./{}.xml".format("metadata_exported_as_xml"), "wb") as fd:
    for block in xml_stream.iter_content(1024):
exists(resource_id: str) → bool[source]

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

Parameters:resource_id (str) – identifier of the resource to verify

Get complete or partial metadata about a specific metadata (= resource).

  • metadata_id (str) – metadata UUID to get
  • include (tuple) –

    subresources that should be included. Available values:

    • one or various from MetadataSubresources (Enum)
    • ”all” to get complete metadata with every subresource included
keywords(metadata: isogeo_pysdk.models.metadata.Metadata, include: tuple = ('_abilities', 'count', 'thesaurus')) → list[source]

Returns asssociated keywords with a metadata. Just a shortcut.

  • metadata (Metadata) – metadata object
  • include (tuple) – subresources that should be returned. Available values:
  • ‘_abilities’
  • ‘count’
  • ‘thesaurus’
Return type:list
update(metadata: isogeo_pysdk.models.metadata.Metadata, _http_method: str = 'PATCH') → isogeo_pysdk.models.metadata.Metadata[source]

Update a metadata, but ONLY the root attributes, not the subresources.

Certain attributes of the Metadata object to update are required:

  • _id
  • editionProfile
  • type


  • metadata (Metadata) – metadata object to update
  • _http_method (str) – HTTP method (verb) to use. Default to ‘PATCH’ but can be set to ‘PUT’ in certain cases (services).
Return type:



the updated metadata or the request error.

# get a metadata
my_metadata = isogeo.metadata.get(metadata_id=METADATA_UUID)
# add an updated watermark in the abstract
my_metadata.abstract += '**Updated!**'
# push it online