isogeo_pysdk.api.routes_catalog module¶
Isogeo API v1 - API Routes for Catalogs entities
See: http://help.isogeo.com/api/complete/index.html
-
class
isogeo_pysdk.api.routes_catalog.
ApiCatalog
(api_client=None)¶ Bases:
object
Routes as methods of Isogeo API used to manipulate catalogs.
-
associate_metadata
(metadata, catalog)¶ Associate a metadata with a catalog.
If the specified catalog is already associated, the response is still 204.
Parameters: Example: isogeo.catalog.associate_metadata( isogeo.metadata.get(METADATA_UUID), isogeo.catalog.get(WORKGROUP_UUID, CATALOG_UUID) ) <Response [204]>
Return type: Response
-
create
(workgroup_id, catalog, check_exists=1)¶ Add a new catalog to a workgroup.
Parameters: - workgroup_id (str) – identifier of the owner workgroup
- catalog (class) – Catalog model object to create
- check_exists (bool) –
check if a catalog already exists into the workgroup:
- 0 = no check
- 1 = compare name [DEFAULT]
Returns: the created catalog or False if a similar cataog already exists or a tuple with response error code
Return type:
-
delete
(workgroup_id, catalog_id)¶ Delete a catalog from Isogeo database.
Parameters: - workgroup_id (str) – identifier of the owner workgroup
- catalog_id (str) – identifier of the resource to delete
-
dissociate_metadata
(metadata, catalog)¶ Removes the association between a metadata and a catalog.
If the specified catalog is not associated, the response is 404.
Parameters: Return type: Response
-
exists
(workgroup_id, catalog_id)¶ Check if the specified catalog exists and is available for the authenticated user.
Parameters: - workgroup_id (str) – identifier of the owner workgroup
- catalog_id (str) – identifier of the catalog to verify
Return type: bool
-
get
(self, workgroup_id, catalog_id, include=('_abilities', 'count'))¶ Get details about a specific catalog.
Parameters: - workgroup_id (str) – identifier of the owner workgroup
- catalog_id (str) – catalog UUID
- include (list) – additionnal subresource to include in the response
Return type:
-
listing
(self, workgroup_id=None, include=('_abilities', 'count'), caching=1)¶ Get workgroup catalogs.
Parameters: - workgroup_id (str) – identifier of the owner workgroup
- include (tuple) – additionnal subresource to include in the response
- caching (bool) – option to cache the response
Return type: list
Example: # retrieve the catalogs of workgroup wg_catalogs = isogeo.catalog.listing( workgroup_id=isogeo_workgroup._id, include=None ) # filter on catalogs with the Sacn checked for cat in wg_catalogs: if cat.get("$scan", False): print(cat.get("name"))
-
metadata
(self, metadata_id)¶ List metadata’s catalogs with complete information.
Parameters: metadata_id (str) – metadata UUID Returns: the list of catalogs associated with the metadata Return type: list
Returns shares for the specified catalog.
Parameters: catalog_id (str) – catalog UUID Returns: list of Shares containing the catalog Return type: list
-
statistics
(self, catalog_id)¶ Returns statistics for the specified catalog.
Parameters: catalog_id (str) – catalog UUID Return type: dict
-
statistics_by_tag
(self, catalog_id, tag)¶ Returns statistics on a specific tag for the specified catalog.
Be careful: if an invalid character is present into the response (e.g. contact.name = ‘bureau GF-3A’), a ConnectionError / ReadTimeout will be raised.
Parameters: - catalog_id (str) – catalog UUID
- tag (str) – tag name. Must be one of: catalog, coordinate-system, format, keyword:inspire-theme, keyword, owner
Return type: dict
-