contrib.sources.document

Module Contents

Classes

OEREBlexSource(self,**kwargs) A document source, that creates records for the received documents from OEREBlex for the specified
class OEREBlexSource(**kwargs)

A document source, that creates records for the received documents from OEREBlex for the specified geoLink.

__init__(**kwargs)

Creates a new OEREBlex document source.

Keyword Args:

host (uri): Host URL of OEREBlex (without /api/…). version (str): The used geoLink schema version. Default is 1.1.0 pass_version (bool): True to pass version in URL, false otherwise. Defaults is false. language (str): The language of the received data. canton (str): Canton code used for the documents. mapping (dict of str): Mapping for optional attributes. related_decree_as_main (bool): Add related decrees directly to the public law restriction. proxy (dict of uri): Optional proxy configuration for HTTP and/or HTTPS. auth (dict of str): Optional credentials for basic authentication. Requires username

and password to be defined.
read(geolink_id)

Requests the geoLink for the specified ID and returns records for the received documents.

Args:
geolink_id (int): The geoLink ID.
_get_document_records(document, references=list)

Converts the received documents into records.

Args:
document (geolink_formatter.entity.Document): The geoLink document to be returned as document
record.

references (list of geolink_formatter.entity.Document): Referenced geoLink documents.

Returns:
list of pyramid_oereb.lib.records.documents.DocumentRecord: The converted record.
_get_mapped_value(document, key, multilingual=False)

Return the value of a mapped optional attribute.

Args:
document (geolink_formatter.entity.Document): The document entity. key (str): The key of the attribute to be mapped. multilingual (bool): True to wrap value in multilingual dictionary.
Returns:
str or None: The value of the mapped attribute.