isogeo_pysdk.models.metadata module

Isogeo API v1 - Model of Metadata (= Resource) entity

See: http://help.isogeo.com/api/complete/index.html#definition-resource

class isogeo_pysdk.models.metadata.Metadata(_abilities=None, _created=None, _creator=None, _id=None, _modified=None, _fieldsLanguage=None, abstract=None, collectionContext=None, collectionMethod=None, conditions=None, contacts=None, coordinateSystem=None, created=None, distance=None, editionProfile=None, encoding=None, envelope=None, events=None, featureAttributes=None, features=None, format=None, formatVersion=None, geoContext=None, geometry=None, keywords=None, language=None, layers=None, limitations=None, links=None, modified=None, name=None, operations=None, path=None, precision=None, published=None, scale=None, series=None, serviceLayers=None, specifications=None, tags=None, thumbnailUrl=None, title=None, topologicalConsistency=None, translations=None, type=None, updateFrequency=None, validFrom=None, validTo=None, validityComment=None, **kwargs)

Bases : object

Metadata are the main entities in Isogeo.

Example:

{
    "_abilities": [
        "string"
    ],
    "_created": "string (date-time)",
    "_creator": {
        "_abilities": [
        "string"
        ],
        "_created": "string (date-time)",
        "_id": "string (uuid)",
        "_modified": "string (date-time)",
        "areKeywordsRestricted": "boolean",
        "canCreateMetadata": "boolean",
        "code": "string",
        "contact": {
        "_created": "string (date-time)",
        "_id": "string (uuid)",
        "addressLine1": "string",
        "addressLine2": "string",
        "addressLine3": "string",
        "available": "string",
        "city": "string",
        "count": "integer (int32)",
        "countryCode": "string",
        "email": "string",
        "fax": "string",
        "hash": "string",
        "name": "string",
        "organization": "string",
        "phone": "string",
        "type": "string",
        "zipCode": "string"
        },
        "keywordsCasing": "string",
        "metadataLanguage": "string",
        "themeColor": "string"
    },
    "_id": "string (uuid)",
    "_modified": "string (date-time)",
    "abstract": "string",
    "bbox": [
        "number (double)"
    ],
    "collectionContext": "string",
    "collectionMethod": "string",
    "conditions": [
        {
        "_id": "string (uuid)",
        "description": "string",
        "license": {
            "_id": "string (uuid)",
            "content": "string",
            "count": "integer (int32)",
            "link": "string",
            "name": "string"
        }
        }
    ],
    "contacts": [
        {
        "_id": "string (uuid)",
        "contact": {
            "_created": "string (date-time)",
            "_id": "string (uuid)",
            "_modified": "string (date-time)",
            "addressLine1": "string",
            "addressLine2": "string",
            "addressLine3": "string",
            "available": "string",
            "city": "string",
            "count": "integer (int32)",
            "countryCode": "string",
            "email": "string",
            "fax": "string",
            "hash": "string",
            "name": "string",
            "organization": "string",
            "phone": "string",
            "type": "string",
            "zipCode": "string"
        },
        "role": "string"
        }
    ],
    "context": "object",
    "coordinate-system": "object",
    "created": "string (date-time)",
    "distance": "number (double)",
    "editionProfile": "string",
    "encoding": "string",
    "envelope": "object",
    "features": "integer (int32)",
    "format": "string",
    "formatVersion": "string",
    "geometry": "string",
    "height": "integer (int32)",
    "keywords": [
        {}
    ],
    "_fieldsLanguage": "string"
}
ATTR_CREA = {'abstract': <class 'str'>, 'collectionContext': <class 'str'>, 'collectionMethod': <class 'str'>, 'distance': <class 'float'>, 'editionProfile': <class 'str'>, 'encoding': <class 'str'>, 'envelope': <class 'dict'>, 'features': <class 'int'>, 'format': <class 'str'>, 'formatVersion': <class 'str'>, 'geoContext': <class 'str'>, 'geometry': <class 'str'>, 'language': <class 'str'>, 'name': <class 'str'>, 'path': <class 'str'>, 'precision': <class 'str'>, 'scale': <class 'int'>, 'series': <class 'bool'>, 'title': <class 'str'>, 'topologicalConsistency': <class 'str'>, 'type': <class 'str'>, 'updateFrequency': <class 'str'>, 'validFrom': <class 'str'>, 'validTo': <class 'str'>, 'validityComment': <class 'str'>}
ATTR_MAP = {'coordinateSystem': 'coordinate-system', 'featureAttributes': 'feature-attributes'}
ATTR_TYPES = {'_abilities': <class 'list'>, '_created': <class 'str'>, '_creator': <class 'dict'>, '_fieldsLanguage': <class 'str'>, '_id': <class 'str'>, '_modified': <class 'str'>, 'abstract': <class 'str'>, 'collectionContext': <class 'str'>, 'collectionMethod': <class 'str'>, 'conditions': <class 'list'>, 'contacts': <class 'list'>, 'coordinateSystem': <class 'dict'>, 'created': <class 'str'>, 'distance': <class 'float'>, 'editionProfile': <class 'str'>, 'encoding': <class 'str'>, 'envelope': <class 'dict'>, 'events': <class 'list'>, 'featureAttributes': <class 'list'>, 'features': <class 'int'>, 'format': <class 'str'>, 'formatVersion': <class 'str'>, 'geoContext': <class 'str'>, 'geometry': <class 'str'>, 'keywords': <class 'list'>, 'language': <class 'str'>, 'layers': <class 'list'>, 'limitations': <class 'list'>, 'links': <class 'list'>, 'modified': <class 'str'>, 'name': <class 'str'>, 'operations': <class 'list'>, 'path': <class 'str'>, 'precision': <class 'str'>, 'published': <class 'str'>, 'scale': <class 'int'>, 'series': <class 'bool'>, 'serviceLayers': <class 'list'>, 'specifications': <class 'list'>, 'tags': <class 'list'>, 'thumbnailUrl': <class 'str'>, 'title': <class 'str'>, 'topologicalConsistency': <class 'str'>, 'translations': <class 'list'>, 'type': <class 'str'>, 'updateFrequency': <class 'str'>, 'validFrom': <class 'str'>, 'validTo': <class 'str'>, 'validityComment': <class 'str'>}
property abstract: str

Gets the abstract.

Renvoie:

The abstract of this Metadata.

Type renvoyé:

str

admin_url(url_base='https://app.isogeo.com')

Returns the administration URL (https://app.isogeo.com) for this metadata.

Paramètres:

url_base (str) – base URL of admin site. Defaults to: https://app.isogeo.com

Type renvoyé:

str

classmethod clean_attributes(raw_object)

Renames attributes which are incompatible with Python (hyphens…). See related issue: https://github.com/isogeo/isogeo-api-py-minsdk/issues/82.

Paramètres:

raw_object (dict) – metadata dictionary returned by a request.json()

Renvoie:

the metadata with correct attributes

Type renvoyé:

Metadata

property collectionContext: str

Gets the collectionContext of this Metadata.

Renvoie:

The collectionContext of this Metadata.

Type renvoyé:

str

property collectionMethod: str

Gets the collection method of this Metadata.

Renvoie:

The collection method of this Metadata.

Type renvoyé:

str

property conditions: list

Gets the conditions of this Metadata.

Renvoie:

The conditions of this Metadata.

Type renvoyé:

list

property contacts: list

Gets the contacts of this Metadata.

Renvoie:

The contacts of this Metadata.

Type renvoyé:

list

property coordinateSystem: CoordinateSystem

Gets the coordinateSystem of this Metadata.

Renvoie:

The coordinateSystem of this Metadata.

Type renvoyé:

CoordinateSystem

property created: str

Gets the creation date of the data described by the Metadata. It’s the equivalent of the created original attribute (renamed to avoid conflicts with the _created` one).

Date format is: %Y-%m-%dT%H:%M:%S+00:00.

Renvoie:

The creation of this Metadata.

Type renvoyé:

str

property distance: str

Gets the distance of this Metadata.

Renvoie:

The distance of this Metadata.

Type renvoyé:

str

property editionProfile: str

Gets the editionProfile of this Metadata.

Renvoie:

The editionProfile of this Metadata.

Type renvoyé:

str

property encoding: str

Gets the encoding of this Metadata.

Renvoie:

The encoding of this Metadata.

Type renvoyé:

str

property envelope: dict

Gets the envelope of this Metadata.

Renvoie:

The envelope of this Metadata.

Type renvoyé:

dict

property events: list

Gets the events of this Metadata.

Renvoie:

The events of this Metadata.

Type renvoyé:

list

property featureAttributes: list

Gets the featureAttributes of this Metadata.

Renvoie:

The featureAttributes of this Metadata.

Type renvoyé:

list

property features: int

Gets the features of this Metadata.

Renvoie:

The features of this Metadata.

Type renvoyé:

int

property format: str

Gets the format of this Metadata.

Renvoie:

The format of this Metadata.

Type renvoyé:

str

property formatVersion: str

Gets the formatVersion of this Metadata.

Renvoie:

The formatVersion of this Metadata.

Type renvoyé:

str

property geoContext: str

Gets the geoContext of this Metadata.

Renvoie:

The geoContext of this Metadata.

Type renvoyé:

str

property geometry: str

Gets the geometry of this Metadata.

Renvoie:

The geometry of this Metadata.

Type renvoyé:

str

property groupId: str

Shortcut to get the UUID of the workgroup which owns the Metadata.

property groupName: str

Shortcut to get the name of the workgroup which owns the Metadata.

property keywords: list

Gets the keywords of this Metadata.

Renvoie:

The keywords of this Metadata.

Type renvoyé:

list

property language: str

Gets the language of this Metadata.

Renvoie:

The language of this Metadata.

Type renvoyé:

str

property layers: list

Gets the layers of this Metadata.

Renvoie:

The layers of this Metadata.

Type renvoyé:

list

property limitations: list

Gets the limitations of this Metadata.

Renvoie:

The limitations of this Metadata.

Type renvoyé:

list

Gets the links of this Metadata.

Renvoie:

The links of this Metadata.

Type renvoyé:

list

property modified: str

Gets the last modification date of the data described by this Metadata.

It’s the equivalent of the created original attribute (renamed to avoid conflicts with the _created` one).

Renvoie:

The modification of this Metadata.

Type renvoyé:

str

property name: str

Gets the name of this Metadata.

Renvoie:

The name of this Metadata.

Type renvoyé:

str

property operations: list

Gets the operations of this Metadata.

Renvoie:

The operations of this Metadata.

Type renvoyé:

list

property path: str

Gets the path of this Metadata.

Renvoie:

The path of this Metadata.

Type renvoyé:

str

property precision: str

Gets the precision of this Metadata.

Renvoie:

The precision of this Metadata.

Type renvoyé:

str

property published: str

Gets the published of this Metadata.

Renvoie:

The published of this Metadata.

Type renvoyé:

str

property scale: str

Gets the scale of this Metadata.

Renvoie:

The scale of this Metadata.

Type renvoyé:

str

property series: str

Gets the series of this Metadata.

Renvoie:

The series of this Metadata.

Type renvoyé:

str

property serviceLayers: list

Gets the serviceLayers of this Metadata.

Renvoie:

The serviceLayers of this Metadata.

Type renvoyé:

list

signature(included_attributes=('coordinateSystem', 'envelope', 'features', 'featureAttributes', 'format', 'geometry', 'groupId', 'name', 'path', 'series', 'title', 'type'))

Calculate a hash cumulating certain attributes values. Useful to Scan or comparison operations.

Paramètres:

included_attributes (tuple) – object attributes to include in hash. Default: {(« coordinateSystem », »envelope », »features », »featuresAttributes », »format », »geometry », »groupId », »name », »path », »series », »title », »type »)})

Type renvoyé:

str

property specifications: list

Gets the specifications of this Metadata.

Renvoie:

The specifications of this Metadata.

Type renvoyé:

list

property tags: list

Gets the tags of this Metadata.

Renvoie:

The tags of this Metadata.

Type renvoyé:

list

property thumbnailUrl: str

Gets the thumbnailUrl of this Metadata.

Renvoie:

The thumbnailUrl of this Metadata.

Type renvoyé:

str

property title: str

Gets the title of this Metadata.

Renvoie:

The title of this Metadata.

Type renvoyé:

str

title_or_name(slugged=False)

Gets the title of this Metadata or the name if there is no title. It can return a slugified value.

Paramètres:

slugged (bool) – slugify title. Defaults to False.

Renvoie:

the title or the name of this Metadata.

Type renvoyé:

str

to_dict()

Returns the model properties as a dict.

Type renvoyé:

dict

to_dict_creation()

Returns the model properties as a dict structured for creation purpose (POST)

Type renvoyé:

dict

to_str()

Returns the string representation of the model.

Type renvoyé:

str

property topologicalConsistency: str

Gets the topologicalConsistency of this Metadata.

Renvoie:

The topologicalConsistency of this Metadata.

Type renvoyé:

str

property translations: list

Gets the translations of this Metadata.

Renvoie:

The translations of this Metadata.

Type renvoyé:

list

property type: str

Gets the type of this Metadata.

Renvoie:

The type of this Metadata.

Type renvoyé:

str

property typeFilter: str

Shortcut to get the type as expected in search filter.

property updateFrequency: str

Gets the updateFrequency of this Metadata.

Renvoie:

The updateFrequency of this Metadata.

Type renvoyé:

str

property validFrom: str

Gets the validFrom of this Metadata.

Renvoie:

The validFrom of this Metadata.

Type renvoyé:

str

property validTo: str

Gets the validTo of this Metadata.

Renvoie:

The validTo of this Metadata.

Type renvoyé:

str

property validityComment: str

Gets the validityComment of this Metadata.

Renvoie:

The validityComment of this Metadata.

Type renvoyé:

str