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, 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, 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)",
        "_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"
        },
        "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": [
        {}
    ]
}
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'>, '_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'>, 'type': <class 'str'>, 'updateFrequency': <class 'str'>, 'validFrom': <class 'str'>, 'validTo': <class 'str'>, 'validityComment': <class 'str'>}
property abstract: str

Gets the abstract.

Returns

The abstract of this Metadata.

Return type

str

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

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

Parameters

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

Return type

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.

Parameters

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

Returns

the metadata with correct attributes

Return type

Metadata

property collectionContext: str

Gets the collectionContext of this Metadata.

Returns

The collectionContext of this Metadata.

Return type

str

property collectionMethod: str

Gets the collection method of this Metadata.

Returns

The collection method of this Metadata.

Return type

str

property conditions: list

Gets the conditions of this Metadata.

Returns

The conditions of this Metadata.

Return type

list

property contacts: list

Gets the contacts of this Metadata.

Returns

The contacts of this Metadata.

Return type

list

property coordinateSystem: CoordinateSystem

Gets the coordinateSystem of this Metadata.

Returns

The coordinateSystem of this Metadata.

Return type

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.

Returns

The creation of this Metadata.

Return type

str

property distance: str

Gets the distance of this Metadata.

Returns

The distance of this Metadata.

Return type

str

property editionProfile: str

Gets the editionProfile of this Metadata.

Returns

The editionProfile of this Metadata.

Return type

str

property encoding: str

Gets the encoding of this Metadata.

Returns

The encoding of this Metadata.

Return type

str

property envelope: str

Gets the envelope of this Metadata.

Returns

The envelope of this Metadata.

Return type

str

property events: list

Gets the events of this Metadata.

Returns

The events of this Metadata.

Return type

list

property featureAttributes: list

Gets the featureAttributes of this Metadata.

Returns

The featureAttributes of this Metadata.

Return type

list

property features: int

Gets the features of this Metadata.

Returns

The features of this Metadata.

Return type

int

property format: str

Gets the format of this Metadata.

Returns

The format of this Metadata.

Return type

str

property formatVersion: str

Gets the formatVersion of this Metadata.

Returns

The formatVersion of this Metadata.

Return type

str

property geoContext: str

Gets the geoContext of this Metadata.

Returns

The geoContext of this Metadata.

Return type

str

property geometry: str

Gets the geometry of this Metadata.

Returns

The geometry of this Metadata.

Return type

str

property groupId: str

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

Return type

str

property groupName: str

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

Return type

str

property keywords: str

Gets the keywords of this Metadata.

Returns

The keywords of this Metadata.

Return type

str

property language: str

Gets the language of this Metadata.

Returns

The language of this Metadata.

Return type

str

property layers: list

Gets the layers of this Metadata.

Returns

The layers of this Metadata.

Return type

list

property limitations: str

Gets the limitations of this Metadata.

Returns

The limitations of this Metadata.

Return type

str

Gets the links of this Metadata.

Returns

The links of this Metadata.

Return type

str

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).

Returns

The modification of this Metadata.

Return type

str

property name: str

Gets the name of this Metadata.

Returns

The name of this Metadata.

Return type

str

property operations: list

Gets the operations of this Metadata.

Returns

The operations of this Metadata.

Return type

list

property path: str

Gets the path of this Metadata.

Returns

The path of this Metadata.

Return type

str

property precision: str

Gets the precision of this Metadata.

Returns

The precision of this Metadata.

Return type

str

property published: str

Gets the published of this Metadata.

Returns

The published of this Metadata.

Return type

str

property scale: str

Gets the scale of this Metadata.

Returns

The scale of this Metadata.

Return type

str

property series: str

Gets the series of this Metadata.

Returns

The series of this Metadata.

Return type

str

property serviceLayers: list

Gets the serviceLayers of this Metadata.

Returns

The serviceLayers of this Metadata.

Return type

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.

Parameters

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

Return type

str

property specifications: str

Gets the specifications of this Metadata.

Returns

The specifications of this Metadata.

Return type

str

property tags: str

Gets the tags of this Metadata.

Returns

The tags of this Metadata.

Return type

str

property thumbnailUrl: str

Gets the thumbnailUrl of this Metadata.

Returns

The thumbnailUrl of this Metadata.

Return type

str

property title: str

Gets the title of this Metadata.

Returns

The title of this Metadata.

Return type

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.

Parameters

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

Returns

the title or the name of this Metadata.

Return type

str

to_dict()

Returns the model properties as a dict.

Return type

dict

to_dict_creation()

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

Return type

dict

to_str()

Returns the string representation of the model.

Return type

str

property topologicalConsistency: str

Gets the topologicalConsistency of this Metadata.

Returns

The topologicalConsistency of this Metadata.

Return type

str

property type: str

Gets the type of this Metadata.

Returns

The type of this Metadata.

Return type

str

property typeFilter: str

Shortcut to get the type as expected in search filter.

Return type

str

property updateFrequency: str

Gets the updateFrequency of this Metadata.

Returns

The updateFrequency of this Metadata.

Return type

str

property validFrom: str

Gets the validFrom of this Metadata.

Returns

The validFrom of this Metadata.

Return type

str

property validTo: str

Gets the validTo of this Metadata.

Returns

The validTo of this Metadata.

Return type

str

property validityComment: str

Gets the validityComment of this Metadata.

Returns

The validityComment of this Metadata.

Return type

str