API reference
Search classes
Module containing the abstract search classes to retrieve DOV data.
- class pydov.search.abstract.AbstractSearch(layer, objecttype)[source]
Abstract search class grouping methods common to all DOV search classes. Not to be instantiated or used directly.
Methods
Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- layerstr
WFS layer to use for searching and retrieving records.
- objecttypepydov.types.AbstractDovType
Subclass of AbstractDovType indicating the associated DOV datatype.
Methods
Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- get_description()[source]
Get the description of this search layer.
- Returns:
- str
The description of this layer.
- get_fields(query=None, type=None, max_cost=None)[source]
Get the metadata of the fields that are available.
- Parameters:
- queryboolean, optional
Whether to only return fields that can be used in an attribute query (True), fields that cannot be used in an attribute query (False) or all fields (None, default).
- typestr, optional
Whether to only return fields of a certain type. Possible values are ‘integer’, ‘float’, ‘string’, ‘date’, ‘datetime’, ‘boolean’ and ‘geometry’. Default is None, meaning fields of all types are returned.
- max_costint, optional
Whether to only return fields with a cost lower or equal to the provided value. Default is None, meaning fields of all costs are returned.
- Returns:
- fieldspydov.search.fields.FieldMetadataList
List containing the metadata of the available fields, where each field metadata includes:
- name (str)
The name of the field.
- definition (str)
The definition of the field.
- type (str)
The datatype of the field.
- list (boolean)
Whether the field value is a list type. The items in the list will be of the type specified above.
- notnull (boolean)
Whether the field is mandatory (True) or can be null (False).
- query (boolean)
Whether the field can be used in an attribute query.
- cost (integer)
The cost associated with the request of this field in the output dataframe.
Optionally, it can contain:
- codelist (list)
A list of valid values for this field, if such a list is available. A codelist contains codes, labels and optionnally definitions.
- search(location=None, query=None, sort_by=None, return_fields=None, max_features=None)[source]
Search for objects of this type. Provide location and/or query and/or max_features. When return_fields is None, all fields are returned.
- Parameters:
- locationpydov.util.location.AbstractLocationFilter or owslib.fes2.BinaryLogicOpType<AbstractLocationFilter> or owslib.fes2.UnaryLogicOpType<AbstractLocationFilter>
Location filter limiting the features to retrieve. Can either be a single instance of a subclass of AbstractLocationFilter, or a combination using And, Or, Not of AbstractLocationFilters.
- queryowslib.fes2.OgcExpression
OGC filter expression to use for searching. This can contain any combination of filter elements defined in owslib.fes2. The query should use the fields provided in get_fields(). Note that not all fields are currently supported as a search parameter.
- sort_byowslib.fes2.SortBy, optional
List of properties to sort by.
- return_fieldslist<str> or tuple<str> or set<str>
A list of fields to be returned in the output data. This should be a subset of the fields provided in get_fields(). Note that not all fields are currently supported as return fields.
- max_featuresint
Limit the maximum number of features to request.
- Returns:
- pandas.core.frame.DataFrame
DataFrame containing the output of the search query.
- Raises:
- pydov.util.errors.InvalidSearchParameterError
When not one of location or query or max_features is provided.
- pydov.util.errors.InvalidFieldError
When at least one of the fields in return_fields is unknown.
When a field that is only accessible as return field is used as a query parameter.
When a field that can only be used as a query parameter is used as a return field.
- AttributeError
When the argument supplied as return_fields is not a list, tuple or set.
- NotImplementedError
This is an abstract method that should be implemented in a subclass.
Boring
Module containing the search classes to retrieve DOV borehole data.
- class pydov.search.boring.BoringSearch(objecttype=<class 'pydov.types.boring.Boring'>)[source]
Search class to retrieve information about boreholes (Boring).
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the Boring type. Optional: defaults to the Boring type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Sondering
Module containing the search classes to retrieve DOV CPT data.
- class pydov.search.sondering.SonderingSearch(objecttype=<class 'pydov.types.sondering.Sondering'>)[source]
Search class to retrieve information about CPT measurements ( Sonderingen).
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the Sondering type. Optional: defaults to the Sondering type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Grondwaterfilter
Module containing the search classes to retrieve DOV groundwater screen data.
- class pydov.search.grondwaterfilter.GrondwaterFilterSearch(objecttype=<class 'pydov.types.grondwaterfilter.GrondwaterFilter'>)[source]
Search class to retrieve information about groundwater screens (GrondwaterFilter).
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the GrondwaterFilter type. Optional: defaults to the GrondwaterFilter type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- search(location=None, query=None, sort_by=None, return_fields=None, max_features=None)[source]
Search for objects of this type. Provide location and/or query and/or max_features. When return_fields is None, all fields are returned.
Excludes ‘empty’ filters (i.e. Putten without Filters) by extending the query with a not-null check on pkey_filter.
- Parameters:
- locationpydov.util.location.AbstractLocationFilter or owslib.fes2.BinaryLogicOpType<AbstractLocationFilter> or owslib.fes2.UnaryLogicOpType<AbstractLocationFilter>
Location filter limiting the features to retrieve. Can either be a single instance of a subclass of AbstractLocationFilter, or a combination using And, Or, Not of AbstractLocationFilters.
- queryowslib.fes2.OgcExpression
OGC filter expression to use for searching. This can contain any combination of filter elements defined in owslib.fes2. The query should use the fields provided in get_fields(). Note that not all fields are currently supported as a search parameter.
- sort_byowslib.fes2.SortBy, optional
List of properties to sort by.
- return_fieldslist<str> or tuple<str> or set<str>
A list of fields to be returned in the output data. This should be a subset of the fields provided in get_fields(). Note that not all fields are currently supported as return fields.
- max_featuresint
Limit the maximum number of features to request.
- Returns:
- pandas.core.frame.DataFrame
DataFrame containing the output of the search query.
- Raises:
- pydov.util.errors.InvalidSearchParameterError
When not one of location or query or max_features is provided.
- pydov.util.errors.InvalidFieldError
When at least one of the fields in return_fields is unknown.
When a field that is only accessible as return field is used as a query parameter.
When a field that can only be used as a query parameter is used as a return field.
- AttributeError
When the argument supplied as return_fields is not a list, tuple or set.
- NotImplementedError
This is an abstract method that should be implemented in a subclass.
Grondwatervergunning
Module containing the search classes to retrieve permit data.
- class pydov.search.grondwatervergunning.GrondwaterVergunningSearch(objecttype=<class 'pydov.types.grondwatervergunning.GrondwaterVergunning'>)[source]
Search class to retrieve information about Gw permits ( all permits: current and historical).
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the GrondwaterVergunning type. Optional: defaults to the GrondwaterVergunning type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Interpretaties
Module containing the search classes to retrieve DOV interpretations.
- class pydov.search.interpretaties.FormeleStratigrafieSearch(objecttype=<class 'pydov.types.interpretaties.FormeleStratigrafie'>)[source]
Search class to retrieve the interpretation for Formele stratigrafie
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the FormeleStratigrafie type. Optional: defaults to the FormeleStratigrafie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- class pydov.search.interpretaties.GecodeerdeLithologieSearch(objecttype=<class 'pydov.types.interpretaties.GecodeerdeLithologie'>)[source]
Search class to retrieve gecodeerde lithologie
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the GecodeerdeLithologie type. Optional: defaults to the GecodeerdeLithologie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- class pydov.search.interpretaties.GeotechnischeCoderingSearch(objecttype=<class 'pydov.types.interpretaties.GeotechnischeCodering'>)[source]
Search class to retrieve geotechnische codering
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the GeotechnischeCodering type. Optional: defaults to the GeotechnischeCodering type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- class pydov.search.interpretaties.HydrogeologischeStratigrafieSearch(objecttype=<class 'pydov.types.interpretaties.HydrogeologischeStratigrafie'>)[source]
Search class to retrieve hydrogeological interpretations
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the HydrogeologischeStratigrafie type. Optional: defaults to the HydrogeologischeStratigrafie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- class pydov.search.interpretaties.InformeleHydrogeologischeStratigrafieSearch(objecttype=<class 'pydov.types.interpretaties.InformeleHydrogeologischeStratigrafie'>)[source]
Search class to retrieve information about informele hydrogeologische stratigrafie.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the InformeleHydrogeologischeStratigrafie type. Optional: defaults to the InformeleHydrogeologischeStratigrafie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- class pydov.search.interpretaties.InformeleStratigrafieSearch(objecttype=<class 'pydov.types.interpretaties.InformeleStratigrafie'>)[source]
Search class to retrieve information about ‘informele stratigrafie’.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the InformeleStratigrafie type. Optional: defaults to the InformeleStratigrafie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- class pydov.search.interpretaties.LithologischeBeschrijvingenSearch(objecttype=<class 'pydov.types.interpretaties.LithologischeBeschrijvingen'>)[source]
Search class to retrieve lithologische beschrijvingen
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the LithologischeBeschrijvingen type. Optional: defaults to the LithologischeBeschrijvingen type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- class pydov.search.interpretaties.QuartairStratigrafieSearch(objecttype=<class 'pydov.types.interpretaties.QuartairStratigrafie'>)[source]
Search class to retrieve the interpretation for Quartair stratigrafie
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the QuartairStratigrafie type. Optional: defaults to the QuartairStratigrafie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Bodemsite
Module containing the search classes to retrieve DOV bodemsite data.
- class pydov.search.bodemsite.BodemsiteSearch(objecttype=<class 'pydov.types.bodemsite.Bodemsite'>)[source]
Search class to retrieve information about bodemlocaties.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the Bodemsite type. Optional: defaults to the Bodemsite type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Bodemlocatie
Module containing the search classes to retrieve DOV bodemlocatie data.
- class pydov.search.bodemlocatie.BodemlocatieSearch(objecttype=<class 'pydov.types.bodemlocatie.Bodemlocatie'>)[source]
Search class to retrieve information about bodemlocaties.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the Bodemlocatie type. Optional: defaults to the Bodemlocatie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Bodemdiepteinterval
Module containing the search classes to retrieve DOV bodemdiepteinterval data.
- class pydov.search.bodemdiepteinterval.BodemdiepteintervalSearch(objecttype=<class 'pydov.types.bodemdiepteinterval.Bodemdiepteinterval'>)[source]
Search class to retrieve information about bodemdiepteintervallen.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the Bodemdiepteinterval type. Optional: defaults to the Bodemdiepteinterval type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Bodemclassificatie
Module containing the search classes to retrieve DOV bodemclassificatie data.
- class pydov.search.bodemclassificatie.BodemclassificatieSearch(objecttype=<class 'pydov.types.bodemclassificatie.Bodemclassificatie'>)[source]
Search class to retrieve information about bodemclassificaties.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the Bodemclassificatie type. Optional: defaults to the Bodemclassificatie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Monster
Module containing the search classes to retrieve DOV monster data.
- class pydov.search.monster.MonsterSearch(objecttype=<class 'pydov.types.monster.Monster'>)[source]
Search class to retrieve information about monsters.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the Monster type. Optional: defaults to the Monster type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Observatie
Module containing the search classes to retrieve DOV observation data.
- class pydov.search.observatie.ObservatieFractiemetingSearch(objecttype=<class 'pydov.types.abstract.AbstractDovType.with_subtype.<locals>.newType'>)[source]
Search class to retrieve information about fraction measurements.
This will return only observations of type ‘Textuurmeting’ and will by default include the fields of the Fractiemeting subtype
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the Observatie type. Optional: defaults to the Observatie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- search(location=None, query=None, sort_by=None, return_fields=None, max_features=None)[source]
Search for objects of this type. Provide location and/or query and/or max_features. When return_fields is None, all fields are returned.
Will return only observations of type ‘Textuurmeting’, by extending the query with a filter on the observatietype field.
- Parameters:
- locationpydov.util.location.AbstractLocationFilter or owslib.fes2.BinaryLogicOpType<AbstractLocationFilter> or owslib.fes2.UnaryLogicOpType<AbstractLocationFilter>
Location filter limiting the features to retrieve. Can either be a single instance of a subclass of AbstractLocationFilter, or a combination using And, Or, Not of AbstractLocationFilters.
- queryowslib.fes2.OgcExpression
OGC filter expression to use for searching. This can contain any combination of filter elements defined in owslib.fes2. The query should use the fields provided in get_fields(). Note that not all fields are currently supported as a search parameter.
- sort_byowslib.fes2.SortBy, optional
List of properties to sort by.
- return_fieldslist<str> or tuple<str> or set<str>
A list of fields to be returned in the output data. This should be a subset of the fields provided in get_fields(). Note that not all fields are currently supported as return fields.
- max_featuresint
Limit the maximum number of features to request.
- Returns:
- pandas.core.frame.DataFrame
DataFrame containing the output of the search query.
- Raises:
- pydov.util.errors.InvalidSearchParameterError
When not one of location or query or max_features is provided.
- pydov.util.errors.InvalidFieldError
When at least one of the fields in return_fields is unknown.
When a field that is only accessible as return field is used as a query parameter.
When a field that can only be used as a query parameter is used as a return field.
- AttributeError
When the argument supplied as return_fields is not a list, tuple or set.
- NotImplementedError
This is an abstract method that should be implemented in a subclass.
- class pydov.search.observatie.ObservatieMeetreeksSearch(objecttype=<class 'pydov.types.abstract.AbstractDovType.with_subtype.<locals>.newType'>)[source]
Search class to retrieve information about observations containing lists of point/value measurements (Meetreeks).
This will return only observations of type ‘Meetreeks’ and will by default include the fields of the Meetreeks subtype
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the Observatie type. Optional: defaults to the Observatie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
- search(location=None, query=None, sort_by=None, return_fields=None, max_features=None)[source]
Search for objects of this type. Provide location and/or query and/or max_features. When return_fields is None, all fields are returned.
Will return only observations of type ‘Meetreeks’, by extending the query with a filter on the observatietype field.
- Parameters:
- locationpydov.util.location.AbstractLocationFilter or owslib.fes2.BinaryLogicOpType<AbstractLocationFilter> or owslib.fes2.UnaryLogicOpType<AbstractLocationFilter>
Location filter limiting the features to retrieve. Can either be a single instance of a subclass of AbstractLocationFilter, or a combination using And, Or, Not of AbstractLocationFilters.
- queryowslib.fes2.OgcExpression
OGC filter expression to use for searching. This can contain any combination of filter elements defined in owslib.fes2. The query should use the fields provided in get_fields(). Note that not all fields are currently supported as a search parameter.
- sort_byowslib.fes2.SortBy, optional
List of properties to sort by.
- return_fieldslist<str> or tuple<str> or set<str>
A list of fields to be returned in the output data. This should be a subset of the fields provided in get_fields(). Note that not all fields are currently supported as return fields.
- max_featuresint
Limit the maximum number of features to request.
- Returns:
- pandas.core.frame.DataFrame
DataFrame containing the output of the search query.
- Raises:
- pydov.util.errors.InvalidSearchParameterError
When not one of location or query or max_features is provided.
- pydov.util.errors.InvalidFieldError
When at least one of the fields in return_fields is unknown.
When a field that is only accessible as return field is used as a query parameter.
When a field that can only be used as a query parameter is used as a return field.
- AttributeError
When the argument supplied as return_fields is not a list, tuple or set.
- NotImplementedError
This is an abstract method that should be implemented in a subclass.
- class pydov.search.observatie.ObservatieSearch(objecttype=<class 'pydov.types.observatie.Observatie'>)[source]
Search class to retrieve information about observations (Observatie).
This will return observations of any type.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
- Parameters:
- objecttypesubclass of pydov.types.abstract.AbstractDovType
Reference to a class representing the Observatie type. Optional: defaults to the Observatie type containing the fields described in the documentation.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Generic
Module containing generic search classes to retrieve DOV WFS data.
- class pydov.search.generic.WfsSearch(layer)[source]
Search class for generic WFS layers from DOV.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Initialisation.
Create a new WfsSearch instance to query a generic WFS layer from DOV. Check out the available WFS layers via https://dov.vlaanderen.be/geonetwork
- Parameters:
- layerstr
Workspace qualified layername of the layer to query.
Methods
get_description()Get the description of this search layer.
get_fields([query, type, max_cost])Get the metadata of the fields that are available.
search([location, query, sort_by, ...])Search for objects of this type.
Object types
Module containing the base DOV data types.
- class pydov.types.abstract.AbstractDovFieldSet[source]
Class representing a set of fields to be used to extend existing fields of a certain AbstractDovType or AbstractDovSubType.
- Attributes:
- intended_forlist of string
Use this fieldset to extend the fields of this type or subtype. Using the fieldset for another (sub)type might not yield the correct results. The list should contain class names of subclassed of AbstractDovType or AbstractDovSubType.
- fieldslist of pydov.types.fields.AbstractField
List of fields of this type.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
get_codelists([superclass])Get a set of codelists defined in the class fields.
Return the names of the fields for this fieldset.
Return the metadata of the fields available for this fieldset.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- classmethod get_field_names()[source]
Return the names of the fields for this fieldset.
- Returns:
- list<str>
List of the field names available for this fieldset. These will also be the names of the columns in the output dataframe.
- classmethod get_fields()[source]
Return the metadata of the fields available for this fieldset.
- Returns:
- collections.OrderedDict<str,dict>
Ordered dictionary mapping the field (column) name to the dictionary containing the metadata of this field.
This metadata dictionary includes at least:
- name (str)
The name of the field in the output data.
- source (str)
The source of the field (either wfs or xml).
- sourcefield (str)
The name of the field in the source (source + sourcefield identify the origin of the data).
- type (str)
Datatype of the output data field (one of string, float, integer, date, datetime).
- definition (str)
The definition of the field.
- notnull (boolean)
Whether the field is mandatory (True) or can be null (False).
- class pydov.types.abstract.AbstractDovSubType[source]
Abstract DOV type grouping fields and methods common to all DOV subtypes. Not to be instantiated or used directly.
- Attributes:
- rootpathstr
XPath expression of the root element of this subtype. Should return all elements of this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
Return the names of the fields available for this subtype.
Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- Raises:
- RuntimeError
When the defined fields of this type are invalid.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
- Attributes:
- rootpath
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
Return the names of the fields available for this subtype.
Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- classmethod from_xml(xml_data)[source]
Build instances of this subtype from XML data.
- Parameters:
- xml_databytes
Raw XML data of the DOV object that contains information about this subtype.
- Yields:
- An instance of this type for each occurrence of the rootpath in
- the XML document.
- classmethod from_xml_element(element)[source]
Build an instance of this subtype from a single XML element.
- Parameters:
- elementetree.Element
XML element representing a single record of this subtype.
- Returns:
- instance of this class
An instance of this class based on the data in the XML element.
- get_data_dicts()[source]
Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
- Returns:
- list(dict)
list of data dictionaries for inclusion in the output dataframe
- classmethod get_field_names()[source]
Return the names of the fields available for this subtype.
- Returns:
- list<str>
List of the field names available for this type. These are also the names of the columns in the output dataframe for this type.
- classmethod get_fields()[source]
Return the metadata of the fields available for this fieldset.
- Returns:
- collections.OrderedDict<str,dict>
Ordered dictionary mapping the field (column) name to the dictionary containing the metadata of this field.
This metadata dictionary includes at least:
- name (str)
The name of the field in the output data.
- source (str)
The source of the field (either wfs or xml).
- sourcefield (str)
The name of the field in the source (source + sourcefield identify the origin of the data).
- type (str)
Datatype of the output data field (one of string, float, integer, date, datetime).
- definition (str)
The definition of the field.
- notnull (boolean)
Whether the field is mandatory (True) or can be null (False).
- class pydov.types.abstract.AbstractDovType(typename, pkey)[source]
Abstract DOV type grouping fields and methods common to all DOV object types. Not to be instantiated or used directly.
- Attributes:
- subtypeslist of subclass of pydov.types.abstract.AbstractDovSubType
List of subtypes of this type.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- typenamestr
Name of the DOV object type.
- pkeystr
Permanent key of this DOV object, being a URI of the form https://www.dov.vlaanderen.be/data/typename/id.
- Attributes:
- pkey_fieldname
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- Raises:
- RuntimeError
When the defined fields of this type are invalid.
- classmethod from_wfs(response, namespace)[source]
Build instances of this type from a WFS response.
- Parameters:
- responsestr or bytes or etree.Element or iterable<etree.Element>
WFS response containing GML features.
Can either be a GML str or byte sequence, in which case it will be parsed and scanned for wfs20:member.
Can also be a single instance of etree.Element containing the parsed GML response.
It can also be an iterable (list, tuple or generator) of etree.Element in which case it will be looped over.
- namespacestr
Namespace associated with this WFS featuretype.
- Yields:
- An instance of this type for each record in the WFS response.
- classmethod from_wfs_element(feature, namespace)[source]
Build an instance of this type from a WFS feature element.
- Parameters:
- featureetree.Element
XML element representing a single record of the WFS layer.
- namespacestr
Namespace associated with this WFS featuretype.
- Returns:
- cls
An instance of this class populated with the data from the WFS element.
- classmethod get_codelists(superclass=None)[source]
Get a set of codelists defined in the class fields.
- Parameters:
- superclasstype, optional
The superclass to check against. If provided, only codelists from subclasses of the given superclass will be returned.
- Returns:
- set
A set of codelists defined in the class fields.
- get_df_array(return_fields=None, session=None)[source]
Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
- Parameters:
- return_fieldslist<str> or tuple<str> or set<str> or iterable<str>
List of fields to include in the data array. The order is ignored, the default order of the fields of the datatype is used instead. Defaults to None, which will include all fields.
- sessionrequests.Session
Session to use to perform HTTP requests for data. Defaults to None, which means a new session will be created for each request.
- Returns:
- list
List of the values of this instance in the same order as the field/column names, for inclusion in the result dataframe of a search operation.
- classmethod get_field_names(return_fields=None, include_subtypes=True, include_wfs_injected=False, include_geometry=False)[source]
Return the names of the fields available for this type.
- Parameters:
- return_fieldsReturnFieldList
List of fields to include in the data array. The order is ignored, the default order of the fields of the datatype is used instead. Defaults to None, which will include all fields.
- include_subtypesboolean
Whether to include fields defined in subtypes (True) or not ( False). Defaults to True.
- include_wfs_injectedboolean
Whether to include fields defined in WFS only, not in the default dataframe for this type. Defaults to False.
- include_geometryboolean
Whether to include geometry fields. Defaults to False.
- Returns:
- list<str>
List of the field names available for this type. These are also the names of the columns in the output dataframe for this type.
- Raises:
- AttributeError
If the type of return_fields is not one of None, list, tuple or set.
- pydov.util.errors.InvalidFieldError
If at least one of the fields listed in return_fields is unknown.
- classmethod get_fields(source=('wfs', 'xml'), include_subtypes=True)[source]
Return the metadata of the fields available for this type.
- Parameters:
- sourcelist<str> or tuple<str> or iterable<str>
A list of sources to include in the output. Can be a combination of one or more of wfs, xml or custom . Defaults to (`wfs, xml).
- include_subtypesboolean
Whether to include fields defined in subtypes (True) or not ( False). Defaults to True.
- Returns:
- collections.OrderedDict<str,dict>
Ordered dictionary mapping the field (column) name to the dictionary containing the metadata of this field.
This metadata dictionary includes at least:
- name (str)
The name of the field in the output data.
- source (str)
The source of the field (either wfs, xml or custom).
- type (str)
Datatype of the output data field (one of string, float, integer, date, datetime, boolean).
- split_fn (function)
Optional, a function to split the value of this field into a list of values.
The metadata dictionary additionally includes for fields with source xml or wfs:
- sourcefield (str)
The name of the field in the source (source + sourcefield identify the origin of the data).
The metadata dictionary additionally includes for fields with source xml or custom:
- definition (str)
The definition of the field.
- notnull (boolean)
Whether the field is mandatory (True) or can be null (False).
- classmethod get_subtypes()[source]
List all available subtypes to use with this type.
- Returns:
- subtypesdict<str,dict>
Dictionary containing the metadata of the available subtypes, where the metadata dictionary includes:
- name (str)
The name of the subtype.
- definition (str)
The definition of the subtype and a list of its fields. For a definition of all the fields, initialise a search object with a type having this subtype and use its get_fields method. E.g. ObjectSearch(DovType.with_subtype(SubType)).get_fields()
- class (class)
Class reference of this subtype.
- classmethod to_df_array(iterable, return_fields=None)[source]
Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
Uses parallel processing to speed up IO operations.
- Parameters:
- iterablelist<DovType> or tuple<DovType> or iterable<DovType>
A list of instances of a DOV type.
- return_fieldslist<str> or tuple<str> or set<str> or iterable<str>
List of fields to include in the data array. The order is ignored, the default order of the fields of the datatype is used instead. Defaults to None, which will include all fields.
- Returns:
- list of list
Dataframe contents in the format of a twodimensional list (rows) of lists (columns). The values in the second list are in the same order as the field/column names, for inclusion in the resulting Pandas dataframe of a search operation.
- classmethod with_subtype(subtype)[source]
Build a new subclass of this type with the given subtype.
- Parameters:
- subtypeAbstractDovSubType
Subtype to use in the new class.
- Returns:
- AbstractDovType
New AbstractDovType with the given subtype.
- Raises:
- TypeError
When the given subtype is not a class.
- ValueError
When the given subtype is not a subclass of AbstractDovSubType.
- class pydov.types.abstract.AbstractFieldsObject[source]
Abstract base class for objects containing fields, e.g. AbstractDovFieldSet, AbstractDovType, AbstractDovSubType.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
get_codelists([superclass])Get a set of codelists defined in the class fields.
Return the metadata of the fields available for this fieldset.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- classmethod extend_fields(extra_fields)[source]
Extend the fields of this type with given extra fields and return the new fieldset.
- Parameters:
- extra_fieldslist of pydov.types.fields.AbstractField
Extra fields to be appended to the existing fields of this type.
- Returns:
- list of pydov.types.fields.AbstractField
List of the existing fields of this type, extended with the extra fields supplied in extra_fields.
- classmethod get_codelists(superclass=None)[source]
Get a set of codelists defined in the class fields.
- Parameters:
- superclasstype, optional
The superclass to check against. If provided, only codelists from subclasses of the given superclass will be returned.
- Returns:
- set
A set of codelists defined in the class fields.
- classmethod get_fields()[source]
Return the metadata of the fields available for this fieldset.
- Returns:
- collections.OrderedDict<str,dict>
Ordered dictionary mapping the field (column) name to the dictionary containing the metadata of this field.
This metadata dictionary includes at least:
- name (str)
The name of the field in the output data.
- source (str)
The source of the field (either wfs or xml).
- sourcefield (str)
The name of the field in the source (source + sourcefield identify the origin of the data).
- type (str)
Datatype of the output data field (one of string, float, integer, date, datetime).
- definition (str)
The definition of the field.
- notnull (boolean)
Whether the field is mandatory (True) or can be null (False).
- classmethod with_extra_fields(extra_fields)[source]
Build a new subclass with the given extra fields added to it.
- Parameters:
- extra_fieldslist of pydov.types.fields.AbstractField or subclass of
AbstractDovFieldSet
Extra fields to be appended to the existing fields of this (sub)type.
- Returns:
- AbstractDov(Sub)Type
New AbstractDov(Sub)Type with the given extra fields.
- class pydov.types.abstract.AbstractTypeCommon[source]
Class grouping methods common to AbstractDovType and AbstractDovSubType.
- Attributes:
- fieldslist of pydov.types.fields.AbstractField
List of fields of this type.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_fields()Return the metadata of the fields available for this fieldset.
List all available fieldsets to use with this (sub)type.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- classmethod get_fieldsets()[source]
List all available fieldsets to use with this (sub)type.
- Returns:
- fieldsetsdict<str,dict>
Dictionary containing the metadata of the available fieldsets, where the metadata dictionary includes:
- name (str)
The name of the fieldsets.
- definition (str)
The definition of the fieldsets and a list of its fields. For a definition of all the fields, initialise a search object with a type extended with this fieldset and use its get_fields method. E.g. ObjectSearch(DovType.with_extra_fields(FieldSet) ).get_fields()
- class (class)
Class reference of this fieldset.
Boring
Module containing the DOV data type for boreholes (Boring), including subtypes.
- class pydov.types.boring.BoorMethode[source]
Bases:
AbstractDovSubTypeSubtype listing the method used to make the borehole.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.boring.Boring(pkey)[source]
Bases:
AbstractDovTypeClass representing the DOV data type for boreholes.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Boring (borehole), being a URI of the form https://www.dov.vlaanderen.be/data/boring/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.boring.Kleur[source]
Bases:
AbstractDovSubTypeSubtype listing the color values of the borehole.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.boring.MethodeXyz[source]
Bases:
AbstractDovFieldSetFieldset containing fields for method and reliability of the point location of the borehole.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_field_names()Return the names of the fields for this fieldset.
get_fields()Return the metadata of the fields available for this fieldset.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Sondering
Module containing the DOV data type for CPT measurements (Sonderingen), including subtypes.
- class pydov.types.sondering.Meetdata[source]
Bases:
AbstractDovSubTypeSubtype listing the CPT measurement results.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.sondering.Sondering(pkey)[source]
Bases:
AbstractDovTypeClass representing the DOV data type for CPT measurements.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Sondering (CPT measurement), being a URI of the form https://www.dov.vlaanderen.be/data/sondering/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.sondering.Techniek[source]
Bases:
AbstractDovSubTypeSubtype listing the different techniques used to perform the CPT.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Grondwaterfilter
Module containing the DOV data type for screens (Filter), including subtypes.
- class pydov.types.grondwaterfilter.GrondwaterFilter(pkey)[source]
Bases:
AbstractDovTypeClass representing the DOV data type for Groundwater screens.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Filter (screen), being a URI of the form https://www.dov.vlaanderen.be/data/filter/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.grondwaterfilter.Gxg[source]
Bases:
AbstractDovSubTypeSubtype listing the GxG values or precalculated groundwaterlevel statistics.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.grondwaterfilter.Peilmeting[source]
Bases:
AbstractDovSubTypeSubtype listing the water head level measurements.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Grondwatervergunning
Module containing the DOV data type for GW permits.
- class pydov.types.grondwatervergunning.GrondwaterVergunning(pkey)[source]
Bases:
AbstractDovTypeClass representing the DOV data type for groundwater abstraction permits.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Gwvergunningen (permits), being a URI of the form https://www.dov.vlaanderen.be/data/installatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Interpretaties
Module containing the DOV data types for interpretations, including subtypes.
- class pydov.types.interpretaties.AbstractBoringInterpretatie(pkey)[source]
Bases:
AbstractDovTypeAbstract base class for interpretations that are linked to boreholes only.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Interpretatie (interpretations), being a URI of the form https://www.dov.vlaanderen.be/data/interpretatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- classmethod from_wfs_element(feature, namespace)[source]
Build an instance of this type from a WFS feature element.
- Parameters:
- featureetree.Element
XML element representing a single record of the WFS layer.
- namespacestr
Namespace associated with this WFS featuretype.
- Returns:
- cls
An instance of this class populated with the data from the WFS element.
- class pydov.types.interpretaties.AbstractCommonInterpretatie(pkey)[source]
Bases:
AbstractDovTypeAbstract base class for interpretations that can be linked to boreholes or cone penetration tests.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Interpretatie (interpretations), being a URI of the form https://www.dov.vlaanderen.be/data/interpretatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.interpretaties.FormeleStratigrafie(pkey)[source]
Bases:
AbstractCommonInterpretatieClass representing the DOV data type for ‘Formele stratigrafie’ interpretations.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Interpretatie (interpretations), being a URI of the form https://www.dov.vlaanderen.be/data/interpretatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.interpretaties.FormeleStratigrafieLaag[source]
Bases:
AbstractDovSubTypeInitialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.interpretaties.GecodeerdeLithologie(pkey)[source]
Bases:
AbstractBoringInterpretatieClass representing the DOV data type for ‘gecodeerde lithologie’ interpretations.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Interpretatie (interpretations), being a URI of the form https://www.dov.vlaanderen.be/data/interpretatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.interpretaties.GecodeerdeLithologieLaag[source]
Bases:
AbstractDovSubTypeInitialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.interpretaties.GeotechnischeCodering(pkey)[source]
Bases:
AbstractBoringInterpretatieClass representing the DOV data type for ‘geotechnische codering’ interpretations.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Interpretatie (interpretations), being a URI of the form https://www.dov.vlaanderen.be/data/interpretatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.interpretaties.GeotechnischeCoderingLaag[source]
Bases:
AbstractDovSubTypeInitialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.interpretaties.HydrogeologischeStratigrafie(pkey)[source]
Bases:
AbstractBoringInterpretatieClass representing the DOV data type for ‘hydrogeologische stratigrafie’ interpretations.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Interpretatie (interpretations), being a URI of the form https://www.dov.vlaanderen.be/data/interpretatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.interpretaties.HydrogeologischeStratigrafieLaag[source]
Bases:
AbstractDovSubTypeInitialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.interpretaties.InformeleHydrogeologischeStratigrafie(pkey)[source]
Bases:
AbstractBoringInterpretatieClass representing the DOV data type for ‘informele stratigrafie’ interpretations.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Interpretatie (interpretations), being a URI of the form https://www.dov.vlaanderen.be/data/interpretatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.interpretaties.InformeleHydrogeologischeStratigrafieLaag[source]
Bases:
AbstractDovSubTypeInitialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.interpretaties.InformeleStratigrafie(pkey)[source]
Bases:
AbstractCommonInterpretatieClass representing the DOV data type for ‘informele stratigrafie’ interpretations.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Interpretatie (interpretations), being a URI of the form https://www.dov.vlaanderen.be/data/interpretatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.interpretaties.InformeleStratigrafieLaag[source]
Bases:
AbstractDovSubTypeInitialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.interpretaties.LithologischeBeschrijvingLaag[source]
Bases:
AbstractDovSubTypeInitialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.interpretaties.LithologischeBeschrijvingen(pkey)[source]
Bases:
AbstractBoringInterpretatieClass representing the DOV data type for ‘lithologische beschrijvingen’ interpretations.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Interpretatie (interpretations), being a URI of the form https://www.dov.vlaanderen.be/data/interpretatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.interpretaties.PkeyBoringField[source]
Bases:
_CustomWfsFieldCustom field to populate pkey_boring in case the interpretation is linked with a Boring.
Methods
calculate(instance)Calculate the value of this custom field for the given instance.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
Get a list of WFS fields that are required by (the calculation of) this custom field.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Initialise a custom field.
- Parameters:
- namestr
Name of this field in the return dataframe.
- datatypeone of ‘string’, ‘integer’, ‘float’, ‘date’, ‘datetime’ or ‘boolean’
Datatype of the values of this field in the return dataframe.
- definitionstr, optional
Definition of this field.
- notnullbool, optional, defaults to False
True if this field is always present (mandatory), False otherwise.
Methods
calculate(instance)Calculate the value of this custom field for the given instance.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
Get a list of WFS fields that are required by (the calculation of) this custom field.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()- calculate(instance)[source]
Calculate the value of this custom field for the given instance.
- Parameters:
- instanceAbstractDovType
Instance of the corresponding type, containing all WFS values in its data dictionary.
- Returns:
- Value to be used for this custom field for this instance. Its datatype
- should match the one set in the initialisation of the custom field.
- Raises:
- NotImplementedError
Implement this in a subclass.
- class pydov.types.interpretaties.PkeySonderingField[source]
Bases:
_CustomWfsFieldCustom field to populate pkey_sondering in case the interpretation is linked with a Sondering.
Methods
calculate(instance)Calculate the value of this custom field for the given instance.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
Get a list of WFS fields that are required by (the calculation of) this custom field.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Initialise a custom field.
- Parameters:
- namestr
Name of this field in the return dataframe.
- datatypeone of ‘string’, ‘integer’, ‘float’, ‘date’, ‘datetime’ or ‘boolean’
Datatype of the values of this field in the return dataframe.
- definitionstr, optional
Definition of this field.
- notnullbool, optional, defaults to False
True if this field is always present (mandatory), False otherwise.
Methods
calculate(instance)Calculate the value of this custom field for the given instance.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
Get a list of WFS fields that are required by (the calculation of) this custom field.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()- calculate(instance)[source]
Calculate the value of this custom field for the given instance.
- Parameters:
- instanceAbstractDovType
Instance of the corresponding type, containing all WFS values in its data dictionary.
- Returns:
- Value to be used for this custom field for this instance. Its datatype
- should match the one set in the initialisation of the custom field.
- Raises:
- NotImplementedError
Implement this in a subclass.
- class pydov.types.interpretaties.QuartairStratigrafie(pkey)[source]
Bases:
AbstractBoringInterpretatieClass representing the DOV data type for ‘Quartairstratigrafie’ interpretations.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Interpretatie (interpretations), being a URI of the form https://www.dov.vlaanderen.be/data/interpretatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.interpretaties.QuartairStratigrafieLaag[source]
Bases:
AbstractDovSubTypeInitialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Bodemsite
Module containing the DOV data type for bodemsites, including subtypes.
- class pydov.types.bodemsite.Bodemsite(pkey)[source]
Bases:
AbstractDovTypeClass representing the DOV data type for bodemsites.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Bodemsite, being a URI of the form https://www.dov.vlaanderen.be/data/bodemsite/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Bodemlocatie
Module containing the DOV data type for bodemlocaties, including subtypes.
- class pydov.types.bodemlocatie.Bodemlocatie(pkey)[source]
Bases:
AbstractDovTypeClass representing the DOV data type for bodemlocaties.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Bodemlocatie, being a URI of the form https://www.dov.vlaanderen.be/data/bodemlocatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Bodemdiepteinterval
Module containing the DOV data type for bodemdiepteintervallen, including subtypes.
- class pydov.types.bodemdiepteinterval.Bodemdiepteinterval(pkey)[source]
Bases:
AbstractDovTypeClass representing the DOV data type for bodemdiepteinterval.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Bodemdiepteinterval, being a URI of the form https://www.dov.vlaanderen.be/data/bodemdiepteinterval/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Bodemclassificatie
Module containing the DOV data type for bodemclassificatie.
- class pydov.types.bodemclassificatie.Bodemclassificatie(pkey)[source]
Bases:
AbstractDovTypeClass representing the DOV data type for bodemclassificaties.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Bodemclassificatie, being a URI of the form https://www.dov.vlaanderen.be/data/**classificatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Monsters
Module containing the DOV data type for monster, including subtypes.
- class pydov.types.monster.BemonsterdObject[source]
Bases:
AbstractDovSubTypeSubtype listing the sampled object(s) of the sample.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.monster.DatumField(name, definition, base_xpath)[source]
Bases:
_CustomXmlFieldRetrieves the time from a TemporeelType XML field.
Methods
calculate(cls, tree)Calculate the value for the custom field.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Initialisation.
- Parameters:
- namestr
Name of this field in the return dataframe.
- definitionstr
Definition of this field.
- base_xpathstr
XPath expression of the TemporeelType XML element.
Methods
calculate(cls, tree)Calculate the value for the custom field.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()- calculate(cls, tree)[source]
Calculate the value for the custom field.
- Parameters:
- clsAbstractDovType
Class of the type this field belongs to.
- treeetree.ElementTree
ElementTree of the DOV XML for this instance.
- Returns:
- str
Date in the format ‘%Y-%m-%d’. Returns the value of the ‘datum’ field from the TemporeelType field. If ‘datum’ is null, returns the date part of the ‘datumtijd’ field.
- class pydov.types.monster.Monster(pkey)[source]
Bases:
AbstractDovTypeClass representing the DOV data type for ground samples.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
Permanent key of the Monster, being a URI of the form https://www.dov.vlaanderen.be/data/monster/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.monster.MonsterBehandelingField(name, definition)[source]
Bases:
_CustomXmlFieldField for retrieving the treatment of the sampling from the relevant XML field.
Methods
calculate(cls, tree)Calculate the value of this custom field from the given XML tree.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Initialise a custom field.
- Parameters:
- namestr
Name of this field in the return dataframe.
- datatypeone of ‘string’, ‘integer’, ‘float’, ‘date’, ‘datetime’ or ‘boolean’
Datatype of the values of this field in the return dataframe.
- definitionstr, optional
Definition of this field.
- notnullbool, optional, defaults to False
True if this field is always present (mandatory), False otherwise.
Methods
calculate(cls, tree)Calculate the value of this custom field from the given XML tree.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()- calculate(cls, tree)[source]
Calculate the value of this custom field from the given XML tree.
- Parameters:
- clsAbstractDovType
Class of the type this field belongs to.
- treeetree.ElementTree
ElementTree of the DOV XML for this instance.
- Returns:
- Value to be used for this custom field for this instance. Its datatype
- should match the one set in the initialisation of the custom field.
- Raises:
- NotImplementedError
Implement this in a subclass.
- class pydov.types.monster.MonsterDetails[source]
Bases:
AbstractDovFieldSetFieldset containing fields with extra details about the sample.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_field_names()Return the names of the fields for this fieldset.
get_fields()Return the metadata of the fields available for this fieldset.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.monster.Monsterbehandeling[source]
Bases:
AbstractDovSubTypeSubtype containing fields about the treatment of the sample.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.monster.Opslaglocatie[source]
Bases:
AbstractDovSubTypeSubtype listing the storage location(s) of the sample.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.monster.TijdstipField(name, definition, base_xpath)[source]
Bases:
_CustomXmlFieldRetrieves the time from a TemporeelType XML field.
Methods
calculate(cls, tree)Calculate the value for the custom field.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Initialisation.
- Parameters:
- namestr
Name of this field in the return dataframe.
- definitionstr
Definition of this field.
- base_xpathstr
XPath expression of the TemporeelType XML element.
Methods
calculate(cls, tree)Calculate the value for the custom field.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()- calculate(cls, tree)[source]
Calculate the value for the custom field.
- Parameters:
- clsAbstractDovType
Class of the type this field belongs to.
- treeetree.ElementTree
ElementTree of the DOV XML for this instance.
- Returns:
- str
Timestamp in the format ‘%H:%M:%S’. Returns the value of the ‘tijdstip’ field from the TemporeelType field. If ‘tijdstip’ is null, returns the time part of the ‘datumtijd’ field.
Observatie
Module containing the DOV data type for observations (Observatie), including subtypes.
- class pydov.types.observatie.Fractiemeting[source]
Bases:
AbstractDovSubTypeSubtype showing the details of a fraction measurement.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.observatie.Meetreeks[source]
Bases:
AbstractDovSubTypeSubtype showing the details of a measurement series.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
Get the field names of the Meetreeks subtype.
Get the fields of the Meetreeks subtype.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
Get the field names of the Meetreeks subtype.
Get the fields of the Meetreeks subtype.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.observatie.MeetreeksWaarde[source]
Bases:
AbstractDovSubTypeSubtype showing the details of a measurement value in a series.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.observatie.NumeriekTekstField(name, definition, basename)[source]
Bases:
_CustomXmlFieldField for retrieving a numeric or text value from the XML, depending on which is available. This is used for fields that can have either a numeric or text representation.
Methods
calculate(cls, tree)Calculate the value of the measurement.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Initialise a NumeriekTekstField with given definition and basename.
- Parameters:
- namestring
Name of the field, used in the resulting dataframe.
- definitionstring
Type-specific definition of the meetwaarde field.
- basenamestring
The basename of the field, which is used to find the correct XML elements in the DOV XML. The field will look for <basename>_numeriek and <basename>_text in the XML to retrieve the value.
Methods
calculate(cls, tree)Calculate the value of the measurement.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()
- class pydov.types.observatie.Observatie(pkey)[source]
Bases:
AbstractDovTypeClass representing the DOV data type for observations.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
Initialisation.
- Parameters:
- pkeystr
- Permanent key of the Observatie (observation),
being a URI of the form
https://www.dov.vlaanderen.be/data/observatie/<id>.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_wfs(response, namespace)Build instances of this type from a WFS response.
from_wfs_element(feature, namespace)Build an instance of this type from a WFS feature element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_df_array([return_fields, session])Return the data array of the instance of this type for inclusion in the resulting output dataframe of a search operation.
get_field_names([return_fields, ...])Return the names of the fields available for this type.
get_fields([source, include_subtypes])Return the metadata of the fields available for this type.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_subtypes()List all available subtypes to use with this type.
to_df_array(iterable[, return_fields])Returns a dataframe array with one or more arrays (rows) for each instance in the given iterable.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
with_subtype(subtype)Build a new subclass of this type with the given subtype.
- class pydov.types.observatie.ObservatieDetails[source]
Bases:
AbstractDovFieldSetFieldset containing fields with extra details about the observation.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_field_names()Return the names of the fields for this fieldset.
get_fields()Return the metadata of the fields available for this fieldset.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.observatie.ObservatieHerhaling[source]
Bases:
AbstractDovSubTypeSubtype showing the repetition information of an observation.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
- class pydov.types.observatie.SecundaireParameter[source]
Bases:
AbstractDovSubTypeSubtype showing the secondary parameter of an observation.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Initialisation.
- Parameters:
- namestr
The name associated with this subtype.
Methods
extend_fields(extra_fields)Extend the fields of this type with given extra fields and return the new fieldset.
from_xml(xml_data)Build instances of this subtype from XML data.
from_xml_element(element)Build an instance of this subtype from a single XML element.
get_codelists([superclass])Get a set of codelists defined in the class fields.
get_data_dicts()Return the data dictionaries for this instance, including subtypes, for inclusion in the output dataframe.
get_field_names()Return the names of the fields available for this subtype.
get_fields()Return the metadata of the fields available for this fieldset.
get_fieldsets()List all available fieldsets to use with this (sub)type.
get_name()Return the name associated with this subtype.
with_extra_fields(extra_fields)Build a new subclass with the given extra fields added to it.
Generic
Module containing the generic DOV data types.
- class pydov.types.generic.WfsTypeFactory[source]
Bases:
objectClass to generate pydov type classes at runtime for given WFS layers.
Methods
get_wfs_type(layer)Generate a new pydov WfsType class for the given layer.
Fields
- class pydov.search.fields.AbstractReturnField(name)[source]
Bases:
objectBase class of ReturnField and GeometryReturnField.
Methods
from_field_name(name)Initialise a new instance from a field name.
Initialisation.
- Parameters:
- namestr
Name of the return field.
Methods
from_field_name(name)Initialise a new instance from a field name.
- class pydov.search.fields.FieldMetadata(base_dict=None)[source]
Bases:
AbstractDictLike,HtmlFormatterClass holding metadata for a field.
Methods
keys()Get the keys of the dictionary.
values()Get the values of the dictionary.
Initialisation.
- Parameters:
- base_dictdict, optional
The base dictionary to wrap. Defaults to None, which means an empty dictionary is used.
Methods
keys()Get the keys of the dictionary.
values()Get the values of the dictionary.
- Raises:
- TypeError
If base_dict is not a dictionary.
- class pydov.search.fields.FieldMetadataList(base_dict=None)[source]
Bases:
AbstractDictLikeList of FieldMetadata objects.
Methods
add(field_metadata)Add a FieldMetadata object to this list.
keys()Get the keys of the dictionary.
values()Get the values of the dictionary.
Initialisation.
- Parameters:
- base_dictdict, optional
The base dictionary to wrap. Defaults to None, which means an empty dictionary is used.
Methods
add(field_metadata)Add a FieldMetadata object to this list.
keys()Get the keys of the dictionary.
values()Get the values of the dictionary.
- Raises:
- TypeError
If base_dict is not a dictionary.
- class pydov.search.fields.GeometryReturnField(geometry_field, epsg=None)[source]
Bases:
AbstractReturnField,EpsgValidatorInitialise a geometry return field.
- Parameters:
- geometry_fieldstr
Name of the geometry field.
- epsgint
EPSG code of the CRS of the geometries that will be returned.
Methods
from_field_name(name)Initialise a new instance from a field name.
- Raises:
- TypeError
If epsg is None, missing or not an integer.
- ValueError
If epsg invalid.
Notes
See https://epsg.io for a list of valid EPSG codes.
- class pydov.search.fields.ReturnField(name)[source]
Bases:
AbstractReturnFieldNormal (non-geometry) return field.
Methods
from_field_name(name)Initialise a new instance from a field name.
Initialisation.
- Parameters:
- namestr
Name of the return field.
Methods
from_field_name(name)Initialise a new instance from a field name.
- class pydov.search.fields.ReturnFieldList(iterable=(), /)[source]
Bases:
listList of return fields used in search methods.
Methods
append(object, /)Append object to the end of the list.
clear(/)Remove all items from list.
copy(/)Return a shallow copy of the list.
count(value, /)Return number of occurrences of value.
extend(iterable, /)Extend list by appending elements from the iterable.
from_field_names(*return_fields)Initiale a ReturnFieldList from a list of return field names.
Return a list with all the names of the fields in this ReturnFieldList.
index(value[, start, stop])Return first index of value.
insert(index, object, /)Insert object before index.
pop([index])Remove and return item at index (default last).
remove(value, /)Remove first occurrence of value.
reverse(/)Reverse IN PLACE.
sort(*[, key, reverse])Sort the list in ascending order and return None.
- classmethod from_field_names(*return_fields)[source]
Initiale a ReturnFieldList from a list of return field names.
- Parameters:
- return_fieldslist or set or tuple of str
List, set or tuple of return field names.
- Returns:
- ReturnFieldList
Equivalent ReturnFieldList.
- Raises:
- AttributeError
If the value of return_fields is not a list, set or tuple.
Module grouping all classes related to pydov field definitions.
- class pydov.types.fields.AbstractField(name, source, datatype, split_fn=None, codelist=None, **kwargs)[source]
Bases:
dictAbstract base class for pydov field definitions. Not to be instantiated directly.
Methods
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Initialise a field.
- Parameters:
- namestr
Name of this field in the return dataframe.
- sourceone of ‘wfs’, ‘xml’, ‘custom_wfs’, ‘custom_xml’
Source of this field.
- datatypeone of ‘string’, ‘integer’, ‘float’, ‘date’, ‘datetime’ or ‘boolean’
Datatype of the values of this field in the return dataframe.
- split_fnoptional, function
Function to split values from this field into a list of values.
- codelistpydov.util.codelists.AbstractCodeList, optional
Codelist associated with this field.
Methods
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()
- class pydov.types.fields.WfsField(name, source_field, datatype, split_fn=None, codelist=None)[source]
Bases:
AbstractFieldClass for a field available in the WFS service.
Methods
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Initialise a WFS field.
- Parameters:
- namestr
Name of this field in the return dataframe.
- source_fieldstr
Name of this field in the source WFS service.
- datatypeone of ‘string’, ‘integer’, ‘float’, ‘date’, ‘datetime’ or ‘boolean’
Datatype of the values of this field in the return dataframe.
- split_fnoptional, function
Function to split values from this field into a list of values.
- codelistpydov.util.codelists.AbstractCodeList, optional
Codelist associated with this field.
Methods
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()
- class pydov.types.fields.XmlField(name, source_xpath, datatype, definition='', notnull=False, codelist=None)[source]
Bases:
AbstractFieldClass for a field available in the XML document.
Methods
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Initialise an XML field.
- Parameters:
- namestr
Name of this field in the return dataframe.
- source_xpathstr
XPath expression of the values of this field in the source XML document.
- datatypeone of ‘string’, ‘integer’, ‘float’, ‘date’, ‘datetime’ or ‘boolean’
Datatype of the values of this field in the return dataframe.
- definitionstr, optional
Definition of this field.
- notnullbool, optional, defaults to False
True if this field is always present (mandatory), False otherwise.
- codelistpydov.util.codelists.AbstractCodeList, optional
Codelist associated with this field.
Methods
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()
Module containing generic custom fields.
- class pydov.types.fields_custom.MvMtawField(definition)[source]
Field for retrieving the mv_mtaw value from the height of the point in relevant cases.
Methods
calculate(cls, tree)Calculate the value of this custom field from the given XML tree.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Initialise a MvMtawField (mv_mtaw) with given definition.
- Parameters:
- definitionstring
Type-specific definition of the mv_mtaw field.
Methods
calculate(cls, tree)Calculate the value of this custom field from the given XML tree.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()- calculate(cls, tree)[source]
Calculate the value of this custom field from the given XML tree.
- Parameters:
- clsAbstractDovType
Class of the type this field belongs to.
- treeetree.ElementTree
ElementTree of the DOV XML for this instance.
- Returns:
- Value to be used for this custom field for this instance. Its datatype
- should match the one set in the initialisation of the custom field.
- Raises:
- NotImplementedError
Implement this in a subclass.
- class pydov.types.fields_custom.OsloCodeListValueField(name, source_xpath, datatype, definition, conceptscheme, notnull=False)[source]
Initialise an OsloCodeListValueField.
This field will return the code part of an OSLO codelist value URI, and associate it with an OsloCodeList based on the given conceptscheme.
- Parameters:
- namestr
Name of this field in the return dataframe.
- source_xpathstr
XPath expression of the values of this field in the source XML document.
- datatypeone of ‘string’, ‘integer’, ‘float’, ‘date’, ‘datetime’ or ‘boolean’
Datatype of the values of this field in the return dataframe.
- definitionstr
Definition of this field.
- conceptschemestr
OSLO conceptscheme which will be used for the associated codelist.
- notnullbool, optional, defaults to False
True if this field is always present (mandatory), False otherwise.
Methods
calculate(cls, tree)Calculate the value of this custom field from the given XML tree.
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()- calculate(cls, tree)[source]
Calculate the value of this custom field from the given XML tree.
- Parameters:
- clsAbstractDovType
Class of the type this field belongs to.
- treeetree.ElementTree
ElementTree of the DOV XML for this instance.
- Returns:
- Value to be used for this custom field for this instance. Its datatype
- should match the one set in the initialisation of the custom field.
- Raises:
- NotImplementedError
Implement this in a subclass.
Search utilities
Query
Module containing extra query classes to build attribute search queries.
- class pydov.util.query.FuzzyJoin(dataframe, on, using=None, modifier='%|{item}|%')[source]
Filter expression to join different searches together in a fuzzy (non-exact) way.
Internally translates to a PropertyLikeList:
FuzzyJoin(df, ‘pkey_boring’, modifier=’%|{item}|%’) is equivalent to
- PropertyLikeList(‘pkey_boring’, list(df[‘pkey_boring’),
modifier=’%|{item}|%’)
which is equivalent to
Or([PropertyIsLike(‘pkey_boring’, ‘%|x|%’), PropertyIsLike( ‘pkey_boring’, ‘%|y|%’), …]) for every x, y, in df[‘pkey_boring’]
Methods
toXML()Return the XML representation of the PropertyInList query.
Initialisation.
- Parameters:
- dataframepandas.DataFrame
Dataframe to use a basis for joining.
- onstr
Name of the column in the queried datatype to join on.
- usingstr, optional
Name of the column in the dataframe to use for joining. By default, the same column name as in on is assumed.
- modifierstr, optional, defaults to ‘%|{item}|%’
Optional, modifier to apply to the dataframe items when constructing the query. You can use the string ‘{item}’ in it which will be replaced by the dataframe item.
Methods
toXML()Return the XML representation of the PropertyInList query.
- Raises:
- ValueError
If the using column is not present in the dataframe.
If using is None and the on column is not present in the dataframe.
If the dataframe does not contain at least a single non-null value in the using column.
- class pydov.util.query.Join(dataframe, on, using=None)[source]
Filter expression to join different searches together.
Internally translates to a PropertyInList:
Join(df, ‘pkey_boring’) is equivalent to
PropertyInList(‘pkey_boring’, list(df[‘pkey_boring’)) which is equivalent to
Or([PropertyIsEqualTo(‘pkey_boring’, x), PropertyIsEqualTo( ‘pkey_boring’, y), …]) for every x, y, in df[‘pkey_boring’]
Methods
toXML()Return the XML representation of the PropertyInList query.
Initialisation.
- Parameters:
- dataframepandas.DataFrame
Dataframe to use a basis for joining.
- onstr
Name of the column in the queried datatype to join on.
- usingstr, optional
Name of the column in the dataframe to use for joining. By default, the same column name as in on is assumed.
Methods
toXML()Return the XML representation of the PropertyInList query.
- Raises:
- ValueError
If the using column is not present in the dataframe.
If using is None and the on column is not present in the dataframe.
If the dataframe does not contain at least a single non-null value in the using column.
- class pydov.util.query.PropertyInList(propertyname, lst)[source]
Filter expression to test whether a given property has one of the values from a list.
Internally translates to an Or combination of PropertyIsEqualTo expressions:
PropertyInList(‘methode’, [‘spade’, ‘spoelboring’]) is equivalent to
Or([PropertyIsEqualTo(‘methode’, ‘spade’), PropertyIsEqualTo(‘methode’, ‘spoelboring’)])
Methods
toXML()Return the XML representation of the PropertyInList query.
Initialisation.
- Parameters:
- propertynamestr
Name of the attribute to query.
- lstlist of str
List of literals to match against (exact matches).
Methods
toXML()Return the XML representation of the PropertyInList query.
- Raises:
- ValueError
If the given list does not contain at least a single item.
- class pydov.util.query.PropertyLikeList(propertyname, lst, modifier='%{item}%')[source]
Filter expression to test whether a given property is like one of the values from a list.
Internally translates to an Or combination of PropertyIsLike expressions:
PropertyLikeList(‘methode’, [‘spade’, ‘spoelboring’], ‘%{item}%’) is equivalent to
Or([PropertyIsLike(‘methode’, ‘%spade%’), PropertyIsLike(‘methode’, ‘%spoelboring%’)])
Methods
toXML()Return the XML representation of the PropertyInList query.
Initialisation.
- Parameters:
- propertynamestr
Name of the attribute to query.
- lstlist of str
List of item literals to match against.
- modifierstr
Optional, modifier to apply to the lst items when constructing the query. You can use the string ‘{item}’ in it which will be replaced by the lst item.
Methods
toXML()Return the XML representation of the PropertyInList query.
- Raises:
- ValueError
If the given list does not contain at least a single item. If the modifier is not of type str.
Location
Module grouping classes for location based filters used for searching.
This module is designed to comply with the WFS 2.0.0 standard, implying Filter Encoding 2.0 and GML 3.2.
- class pydov.util.location.AbstractBinarySpatialFilter(type, location)[source]
Bases:
AbstractLocationFilterClass representing a binary spatial filter.
Binary spatial filters are ogc:BinarySpatialOpType elements, i.e. one of Equals, Disjoint, Touches, Within, Overlaps, Crosses, Intersects or Contains.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
Initialise a Binary spatial filter.
- Parameters:
- typestr
Type of this filter: one of Equals, Disjoint, Touches, Within, Overlaps, Crosses, Intersects or Contains.
- locationAbstractLocation
An instance of a location to use as location for the spatial filter.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- set_geometry_column(geometry_column)[source]
Set the name of the geometry column to query.
- Parameters:
- geometry_columnstr
The name of the geometry column to query.
- toXML()[source]
Return the XML representation of the location filter.
Should raise a RuntimeError when called before the geometry column is set through set_geometry_column: location filters without the geometry column name are invalid.
- Returns:
- etree.Element
XML element of this location filter.
- Raises:
- RuntimeError
When called before the geometry column name is set: location filters without the geometry column name are invalid.
- class pydov.util.location.AbstractLocation[source]
Bases:
EpsgValidatorAbstract base class for location types (f.ex. point, box, polygon).
Locations are GML elements, for inclusion in the WFS GetFeature request. As described in the Filter Encoding 2.0 standard, locations are expressed using GML 3.2.
The initialisation should require all necessary parameters to construct a valid location of this type: i.e. all locations should be valid after initialisation.
Methods
Return the GML representation of the location.
- class pydov.util.location.AbstractLocationFilter[source]
Bases:
objectAbstract base class for location filters (f.ex. within, dwithin).
Location filters are ogc:SpatialOpsType elements, for inclusion in the WFS GetFeature request.
The initialisation should accept at least a (subclass of) AbstractLocation and require all additional parameters that are required for a valid location filter of this type.
One exception is the name of the geometry column to query: this is set automatically upon building the WFS GetFeature request using the set_geometry_column method.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- set_geometry_column(geometry_column)[source]
Set the name of the geometry column to query.
- Parameters:
- geometry_columnstr
The name of the geometry column to query.
- toXML()[source]
Return the XML representation of the location filter.
Should raise a RuntimeError when called before the geometry column is set through set_geometry_column: location filters without the geometry column name are invalid.
- Returns:
- etree.Element
XML element of this location filter.
- Raises:
- RuntimeError
When called before the geometry column name is set: location filters without the geometry column name are invalid.
- class pydov.util.location.Box(minx, miny, maxx, maxy, epsg=None)[source]
Bases:
AbstractLocationClass representing a box location, also known as bounding box, envelope, extent.
Methods
Return the GML representation of the location.
Initialise a Box.
To initialise a Box using GPS coordinates in decimal degrees, use epsg=4326 and enter the longitude range as minx and maxx and the latitude range as miny and maxy.
- Parameters:
- minxfloat
X coordinate of the lower left corner of the box.
- minyfloat
Y coordinate of the lower left corner of the box.
- maxxfloat
X coordinate of the upper right corner of the box.
- maxyfloat
Y coordinate of the upper right corner of the box.
- epsgint
EPSG code of the coordinate reference system (CRS) of the coordinates specified in minx, miny, maxx, maxy.
Methods
Return the GML representation of the location.
- Raises:
- TypeError
If epsg is None, missing or not an integer.
- ValueError
If maxx is lower than or equal to minx. If maxy is lower than or equal to miny. If epsg is invalid
Notes
See https://epsg.io for a list of valid EPSG codes.
- class pydov.util.location.Disjoint(location)[source]
Bases:
AbstractBinarySpatialFilterClass representing a spatial Disjoint filter.
A spatial Disjoint will return all points that are disjoint from a polygon or box location: i.e. that are not inside nor on the boundary.
A spatial Disjoint is the inverse of a spatial Intersects.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
Initialise a Disjoint filter.
- Parameters:
- locationAbstractLocation
An instance of a location to use as location for the Disjoint filter.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- class pydov.util.location.EpsgValidator[source]
Bases:
objectClass grouping methods for enforcing and validating EPSG parameters.
- class pydov.util.location.Equals(location)[source]
Bases:
AbstractBinarySpatialFilterClass representing a spatial Equals filter.
A spatial Equals will return all points that are equal to another point.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
Initialise an Equals filter.
- Parameters:
- locationAbstractLocation
An instance of a location to use as location for the Equals filter.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- class pydov.util.location.GeometryFilter(geometry, location_filter, location_filter_kwargs=None, combinator=<class 'owslib.fes2.Or'>)[source]
Bases:
GmlFilterClass for construction a spatial filter expression from any Geometry Fiona can convert to a GML 3.2 document.
This class requires the
fionapackage to be installed.Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
Initialise a spatial filter expression from a given Geometry.
- Parameters:
- geometrystr
A path to a vector file on disk.
- location_filterclass<AbstractLocationFilter>
Location filter to use for the geometries in the GML document.
- location_filter_kwargsdict, optional
Keyword-based arguments to pass to the location_filter on initialisation (with the exception of the location parameter, which is automatically parsed from the geomery). Can be skipped in cases where the location_filter takes no extra arguments besides location.
- combinatorclass<BinaryLogicOpType>, optional, defaults to Or
One of (Or, And) used to combine filters for different geometries in the geometry document.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- Raises:
- ValueError
When no geometries could be parsed from the given geometry.
- class pydov.util.location.GeopandasFilter(geodataframe, location_filter, location_filter_kwargs=None, combinator=<class 'owslib.fes2.Or'>)[source]
Bases:
GmlFilterClass for construction a spatial filter expression from a GeoPandas object.
This class requires the
geopandaspackage to be installed.Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
Initialise a spatial filter expression from a GeoPandas GeoDataFrame.
- Parameters:
- geodataframeGeoPandas.GeoDataFrame
A GeoDataFrame with a valid crs.
- location_filterclass<AbstractLocationFilter>
Location filter to use for the geometries in the GML document.
- location_filter_kwargsdict, optional
Keyword-based arguments to pass to the location_filter on initialisation (with the exception of the location parameter, which is automatically parsed from the geomery). Can be skipped in cases where the location_filter takes no extra arguments besides location.
- combinatorclass<BinaryLogicOpType>, optional, defaults to Or
One of (Or, And) used to combine filters for different geometries in the geometry document.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- Raises:
- ValueError
When no geometries could be parsed from the given geometry.
- class pydov.util.location.GmlFilter(gml, location_filter, location_filter_kwargs=None, combinator=<class 'owslib.fes2.Or'>)[source]
Bases:
AbstractLocationFilterClass for construction a spatial filter expression from a GML3.2 document.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
Initialise a spatial filter expression from a GML3.2 string.
- Parameters:
- gmlstr
Either a string representation of the GML document to parse, or a path to a GML3.2 file on disk.
- location_filterclass<AbstractLocationFilter>
Location filter to use for the geometries in the GML document.
- location_filter_kwargsdict, optional
Keyword-based arguments to pass to the location_filter on initialisation (with the exception of the location parameter, which is automatically parsed from the GML). Can be skipped in cases where the location_filter takes no extra arguments besides location.
- combinatorclass<BinaryLogicOpType>, optional, defaults to Or
One of (Or, And) used to combine filters for different geometries in the GML document.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- Raises:
- ValueError
When no geometries could be parsed from the given GML record.
- set_geometry_column(geometry_column)[source]
Set the name of the geometry column to query.
- Parameters:
- geometry_columnstr
The name of the geometry column to query.
- toXML()[source]
Return the XML representation of the location filter.
Should raise a RuntimeError when called before the geometry column is set through set_geometry_column: location filters without the geometry column name are invalid.
- Returns:
- etree.Element
XML element of this location filter.
- Raises:
- RuntimeError
When called before the geometry column name is set: location filters without the geometry column name are invalid.
- class pydov.util.location.GmlObject(gml_element)[source]
Bases:
AbstractLocationClass representing a raw GML3.2 location, f.ex. gml32:Surface or gml32:MultiSurface.
Methods
Return the GML representation of the location.
Initialise a GmlObject.
Initialise a GmlObject from an existing XML element representing a GML3.2 location.
- Parameters:
- gml_elementetree.Element or str or bytes
XML element of the GML3.2 location, either as etree.Element, bytes or string representation.
Methods
Return the GML representation of the location.
- class pydov.util.location.Intersects(location)[source]
Bases:
AbstractBinarySpatialFilterClass representing a spatial Intersects filter.
A spatial Intersects will return all points that are within or on the boundary of a polygon or box location.
A spatial Intersects is the inverse of a spatial Disjoint.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
Initialise an Intersects filter.
- Parameters:
- locationAbstractLocation
An instance of a location to use as location for the Intersects filter.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- class pydov.util.location.Point(x, y, epsg=None)[source]
Bases:
AbstractLocationClass representing a point location.
Methods
Return the GML representation of the location.
Initialise a Point.
To initialise a Point using GPS coordinates in decimal degrees, use epsg=4326 and enter the longitude as x and the latitude as y.
- Parameters:
- xfloat
X coordinate (or longitude) of the point.
- yfloat
Y coordinate (or latitude) of the point.
- epsgint
EPSG code of the coordinate reference system (CRS) of the coordinates specified in x, y.
Methods
Return the GML representation of the location.
- Raises:
- TypeError
If epsg is None, missing or not an integer.
- ValueError
If epsg invalid.
Notes
See https://epsg.io for a list of valid EPSG codes.
- class pydov.util.location.Touches(location)[source]
Bases:
AbstractBinarySpatialFilterClass representing a spatial Touches filter.
A spatial Touches will return all points that touch a polygon or box location: i.e. that are on the boundary but not inside.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
Initialise a Touches filter.
- Parameters:
- locationAbstractLocation
An instance of a location to use as location for the Touches filter.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- class pydov.util.location.Within(location)[source]
Bases:
AbstractBinarySpatialFilterClass representing a spatial Within filter.
A spatial Within will return all points that are entirely within a polygon or box location (i.e. are not on the boundary).
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
Initialise a Within filter.
- Parameters:
- locationAbstractLocation
An instance of a location to use as location for the Within filter.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- class pydov.util.location.WithinDistance(location, distance, distance_unit='meter')[source]
Bases:
AbstractLocationFilterClass representing a spatial DWithin filter.
A spatial DWithin will return all points that are within a given distance of a certain location.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
Initialise a WithinDistance filter.
- Parameters:
- locationAbstractLocation
An instance of a location to use as location for the WithinDistance filter.
- distancefloat
Amount of distance units to use for the filter.
- distance_unitstring, optional, defaults to ‘meter’
The distance unit of the value of distance.
Methods
set_geometry_column(geometry_column)Set the name of the geometry column to query.
toXML()Return the XML representation of the location filter.
- set_geometry_column(geometry_column)[source]
Set the name of the geometry column to query.
- Parameters:
- geometry_columnstr
The name of the geometry column to query.
- toXML()[source]
Return the XML representation of the location filter.
Should raise a RuntimeError when called before the geometry column is set through set_geometry_column: location filters without the geometry column name are invalid.
- Returns:
- etree.Element
XML element of this location filter.
- Raises:
- RuntimeError
When called before the geometry column name is set: location filters without the geometry column name are invalid.
OWS utilities
Module grouping utility functions for OWS services.
- pydov.util.owsutil.get_csw_base_url(contentmetadata)[source]
Get the CSW base url for the remote metadata associated with the layer described in contentmetadata.
- Parameters:
- contentmetadataowslib.feature.wfs110.ContentMetadata
Content metadata associated with a WFS layer.
- Returns:
- urlstr or None
Base URL of the CSW service where the remote metadata and feature catalogue can be requested or None when no metadata URL could be found.
- pydov.util.owsutil.get_featurecatalogue_uuid(md_metadata)[source]
Get the UUID of the feature catalogue associated with the metadata.
- Parameters:
- md_metadataowslib.iso.MD_Metadata
Metadata parsed according to the ISO 19115/19139 format.
- Returns:
- uuidstr or None
Universally unique identifier of the feature catalogue associated with the metadata or None when there is no feature catalogue available.
- pydov.util.owsutil.get_namespace(wfs, layer)[source]
Request the namespace associated with a layer by performing a DescribeFeatureType request.
- Parameters:
- wfsowslib.wfs.WebFeatureService
WFS service to use, associated with the layer.
- layerstr
Workspace-qualified name of the layer to get the namespace of ( typename).
- Returns:
- namespacestr
URI of the namespace associated with the given layer.
- pydov.util.owsutil.get_remote_featurecatalogue(csw_url, fc_uuid)[source]
Request and parse the remote feature catalogue described by the CSW base url and feature catalogue UUID.
- Parameters:
- csw_urlstr
Base URL of the CSW service to query, should end with ‘csw’.
- fc_uuidstr
Universally unique identifier of the feature catalogue.
- Returns:
- dict or None
Dictionary with fields described in the feature catalogue, using the following schema, or None when no feature catalogue with the given UUID could not be found:
>>> {'definition' : 'feature type definition', >>> 'attributes' : {'name': >>> {'definition' : 'attribute definition', >>> 'values' : ['list of', 'values'], >>> 'multiplicity': (lower, upper)} >>> } >>> }
Where the lower multiplicity is always and integer and the upper multiplicity is either an integer or the str ‘Inf’ indicating an infinate value.
- pydov.util.owsutil.get_remote_metadata(contentmetadata)[source]
Request and parse the remote metadata associated with the layer described in contentmetadata.
- Parameters:
- contentmetadataowslib.feature.wfs110.ContentMetadata
Content metadata associated with a WFS layer, containing the associated metadataUrls.
- Returns:
- owslib.iso.MD_Metadata or None
Parsed remote metadata describing the WFS layer in more detail, in the ISO 19115/19139 format, or None when no metadata could be found or parsed.
- pydov.util.owsutil.get_url(url)[source]
Perform a GET request to an OWS service an return the result.
- Parameters:
- urlstr
URL to request.
- Returns:
- bytes
Response containing the result of the GET request.
- pydov.util.owsutil.get_wfs_capabilities(url)[source]
Perform a GET request to get the WFS capabilities.
- Parameters:
- urlstr
URL to request.
- Returns:
- bytes
Response containing the result of the WFS capabilities request.
- pydov.util.owsutil.get_wfs_max_features(capabilities)[source]
Get the default maximum number of features the WFS service will return.
- Parameters:
- capabilitiesbytes
WFS 2.0.0 capabilities document.
- pydov.util.owsutil.set_geometry_column(location, geometry_column)[source]
Set the geometry column of the location query recursively.
- Parameters:
- locationpydov.util.location.AbstractLocationFilter or owslib.fes2.BinaryLogicOpType<AbstractLocationFilter> or owslib.fes2.UnaryLogicOpType<AbstractLocationFilter>
Location filter limiting the features to retrieve. Can either be a single instance of a subclass of AbstractLocationFilter, or a combination using And, Or, Not of AbstractLocationFilters.
- geometry_columnstr
The name of the geometry column to query.
- Returns:
- etree.Element
XML element of this location filter.
- pydov.util.owsutil.typeconvert(text, returntype)[source]
Parse the text to the given returntype.
- Parameters:
- textstr
Text to convert
- returntypestr
Parse the text to this output datatype. One of string, float, integer, date, datetime, boolean.
- Returns:
- str or float or int or bool or datetime.date or datetime.datetime
Returns the parsed text converted to the type described by returntype.
- pydov.util.owsutil.unique_gml_ids(location)[source]
Make sure the location query has unique GML id’s for all features.
- Parameters:
- locationetree.ElementTree
XML tree of the location filter.
- Returns
- ——-
- etree.ElementTree
XML tree of the location filter with unique GML ids.
- pydov.util.owsutil.wfs_build_getfeature_request(typename, geometry_column=None, location=None, filter=None, sort_by=None, propertyname=None, max_features=None, start_index=0, crs=None)[source]
Build a WFS 2.0 GetFeature request in XML to be used as payload in a WFS 2.0 GetFeature request using POST.
- Parameters:
- typenamestr
Typename to query.
- geometry_columnstr, optional
Name of the geometry column to use in the spatial filter. Required if the
locationparameter is supplied.- locationpydov.util.location.AbstractLocationFilter
Location filter limiting the features to retrieve. Requires
geometry_columnto be supplied as well.- filterstr of owslib.fes2.FilterRequest, optional
Filter request to search on attribute values.
- sort_bystr of owslib.fes2.SortBy, optional
List of properties to sort by.
- propertynamelist<str>, optional
List of properties to return. Defaults to all properties.
- max_featuresint
Limit the maximum number of features to request.
- start_indexint
The index of the first feature to return.
- crsstr
EPSG code of the CRS of the geometries that will be returned. Defaults to None, which means the default CRS of the WFS layer.
- Returns:
- elementetree.Element
XML element representing the WFS GetFeature request.
- Raises:
- AttributeError
If
bboxis given withoutgeometry_column. Ifmax_featureshas an invalid value. Ifstart_indexhad an invalid value.- TypeError
If
crsis not a string.- ValueError
If
crsdoes not start with ‘EPSG’.
- pydov.util.owsutil.wfs_get_feature(baseurl, get_feature_request, session=None)[source]
Perform a WFS request using POST.
- Parameters:
- baseurlstr
Base URL of the WFS service.
- get_feature_requestetree.Element
XML element representing the WFS GetFeature request.
- sessionrequests.Session
Session to use to perform HTTP requests for data. Defaults to None, which means a new session will be created for each request.
- Returns:
- bytes
Response of the WFS service.
DOV utilities
Module grouping utility functions for DOV XML services.
- pydov.util.dovutil.build_dov_sparql_request(query)[source]
Build a request with the given SPARQL query for execution on the DOV SPARQL endpoint.
- Parameters:
- querystr
SPARQL query to execute.
- Returns:
- requests.Request
Request prepared with the correct endpoint, parameters and headers to execute the SPARQL query.
- pydov.util.dovutil.build_dov_url(path)[source]
Build the DOV url consisting of the fixed DOV base url, appended with the given path.
- Returns:
- str
The absolute DOV url.
- pydov.util.dovutil.get_dov_xml(url, session=None)[source]
Request the XML from the remote DOV webservices and return it.
- Parameters:
- urlstr
URL of the DOV object to download.
- sessionrequests.Session
Session to use to perform HTTP requests for data. Defaults to None, which means a new session will be created for each request.
- Returns:
- xmlbytes
The raw XML data of this DOV object as bytes.
- pydov.util.dovutil.get_remote_request(request, session=None)[source]
Prepare the request, execute it and return its contents.
- Parameters:
- requestrequests.Request
Request to execute.
- sessionrequests.Session
Session to use to perform HTTP requests for data. Defaults to None, which means a new session will be created for each request.
- Returns:
- xmlbytes
The raw XML data as bytes.
- pydov.util.dovutil.get_remote_url(url, session=None)[source]
Request the URL from the remote service and return its contents.
- Parameters:
- urlstr
URL to download.
- sessionrequests.Session
Session to use to perform HTTP requests for data. Defaults to None, which means a new session will be created for each request.
- Returns:
- xmlbytes
The raw XML data as bytes.
Codelists
- class pydov.util.codelists.AbstractCodeList[source]
Bases:
AbstractDictLike,HtmlFormatterAbstract base class for codelists.
Methods
add_item(item)Add an item to the codelist.
add_items(items)Add multiple items to the codelist.
get(*args, **kwargs)Get an item from the codelist.
Get the codelist.
get_definition(code)Get the definition for a given code.
get_label(code)Get the label for a given code.
Get the values of the codelist.
is_empty()Check if the codelist is empty.
keys()Get the keys of the dictionary.
values()Get the values of the dictionary.
Initialisation.
Methods
add_item(item)Add an item to the codelist.
add_items(items)Add multiple items to the codelist.
get(*args, **kwargs)Get an item from the codelist.
Get the codelist.
get_definition(code)Get the definition for a given code.
get_label(code)Get the label for a given code.
Get the values of the codelist.
is_empty()Check if the codelist is empty.
keys()Get the keys of the dictionary.
values()Get the values of the dictionary.
- add_item(item)[source]
Add an item to the codelist.
- Parameters:
- itemCodeListItem
The item to add to the codelist.
- add_items(items)[source]
Add multiple items to the codelist.
- Parameters:
- itemslist of CodeListItem
The items to add to the codelist.
- get(*args, **kwargs)[source]
Get an item from the codelist.
- Parameters:
- *args
Arguments to pass to the underlying dictionary get method.
- **kwargs
Keyword arguments to pass to the underlying dictionary get method.
- Returns:
- itemCodeListItem or None
The item for the given code, or None if the code is not found.
- get_definition(code)[source]
Get the definition for a given code.
- Parameters:
- codestr
The code to get the definition for.
- Returns:
- definitionstr or None
The definition for the given code, or None if the code is not found.
- get_label(code)[source]
Get the label for a given code.
- Parameters:
- codestr
The code to get the label for.
- Returns:
- labelstr or None
The label for the given code, or None if the code is not found.
- class pydov.util.codelists.AbstractResolvableCodeList(datatype)[source]
Bases:
AbstractCodeListAbstract base class for resolvable codelists.
A resolvable codelist will load its values from another datasource.
Methods
add_item(item)Add an item to the codelist.
add_items(items)Add multiple items to the codelist.
get(*args, **kwargs)Get an item from the codelist.
Get the codelist.
get_definition(code)Get the definition for a given code.
get_id()Get a unique id for this codelist.
get_label(code)Get the label for a given code.
Fetch the remote codelist.
Get the values of the codelist.
is_empty()Check if the codelist is empty.
keys()Get the keys of the dictionary.
parse_codelist_items(codelist)Parse the codelist items from the fetched codelist.
resolve()Resolve the remote codelist values.
values()Get the values of the dictionary.
Initialisation.
- Parameters:
- datatypestr
The datatype of the codes of the codelist. One of string, float, integer, date, datetime, boolean.
Methods
add_item(item)Add an item to the codelist.
add_items(items)Add multiple items to the codelist.
get(*args, **kwargs)Get an item from the codelist.
Get the codelist.
get_definition(code)Get the definition for a given code.
get_id()Get a unique id for this codelist.
get_label(code)Get the label for a given code.
Fetch the remote codelist.
Get the values of the codelist.
is_empty()Check if the codelist is empty.
keys()Get the keys of the dictionary.
parse_codelist_items(codelist)Parse the codelist items from the fetched codelist.
resolve()Resolve the remote codelist values.
values()Get the values of the dictionary.
- get_definition(code)[source]
Get the definition for a given code.
- Parameters:
- codestr
The code to get the definition for.
- Returns:
- definitionstr or None
The definition for the given code, or None if the code is not found.
- get_id()[source]
Get a unique id for this codelist. Needs to be unique among all codelists and will be used for caching.
- Raises:
- NotImplementedError
This is an abstract method that should be implemented in a subclass.
- get_label(code)[source]
Get the label for a given code.
- Parameters:
- codestr
The code to get the label for.
- Returns:
- labelstr or None
The label for the given code, or None if the code is not found.
- get_remote_codelist()[source]
Fetch the remote codelist.
- Returns:
- codelistany
Codelist in a format that can be parsed by the parse_codelist_items method.
- Raises:
- NotImplementedError
This is an abstract method that should be implemented in a subclass.
- get_values()[source]
Get the values of the codelist.
- Returns:
- valuesdict
A dictionary with the codes as keys and the labels as values.
- is_empty()[source]
Check if the codelist is empty.
- Returns:
- is_emptybool
True if the codelist is empty, False otherwise.
- class pydov.util.codelists.CodeListItem(code: str, label: str, definition: str = None)[source]
Bases:
HtmlFormatterClass to represent an item in a codelist.
- Attributes:
- codestr
The code of the item.
- labelstr
The label of the item.
- definitionstr, optional
The definition of the item.
- class pydov.util.codelists.FeatureCatalogueValues[source]
Bases:
AbstractCodeListClass representing a codelist from feature catalogue values.
Methods
add_item(item)Add an item to the codelist.
add_items(items)Add multiple items to the codelist.
get(*args, **kwargs)Get an item from the codelist.
get_codelist()Get the codelist.
get_definition(code)Get the definition for a given code.
get_label(code)Get the label for a given code.
get_values()Get the values of the codelist.
is_empty()Check if the codelist is empty.
keys()Get the keys of the dictionary.
values()Get the values of the dictionary.
Initialisation.
Methods
add_item(item)Add an item to the codelist.
add_items(items)Add multiple items to the codelist.
get(*args, **kwargs)Get an item from the codelist.
get_codelist()Get the codelist.
get_definition(code)Get the definition for a given code.
get_label(code)Get the label for a given code.
get_values()Get the values of the codelist.
is_empty()Check if the codelist is empty.
keys()Get the keys of the dictionary.
values()Get the values of the dictionary.
- class pydov.util.codelists.MemoryCache[source]
Bases:
objectSimple cache to save objects in memory.
Used here to avoid downloading the same codelists twice during the runtime of a pydov session.
Methods
clear()Clear the memory cache.
get(key, fn, *args, **kwargs)Retrieve an object from the in-memory cache or generate it if not present.
- static clear()[source]
Clear the memory cache.
This method clears the memory cache, removing all cached data.
- static get(key, fn, *args, **kwargs)[source]
Retrieve an object from the in-memory cache or generate it if not present.
This method checks if the provided key is present in the cache. If the key is not found, it calls the provided fn function with the given *args and **kwargs, and stores the result in the cache under the key.
If the key is found in the cache, the method simply returns the cached object.
- Returns:
- object
The object retrieved from the cache or generated by the fn function.
- class pydov.util.codelists.OsloCodeList(conceptscheme, datatype)[source]
Bases:
AbstractResolvableCodeListClass representing a codelist in the OSLO linked data format.
Methods
add_item(item)Add an item to the codelist.
add_items(items)Add multiple items to the codelist.
Build the SPARQL query to fetch the codelist from DOV.
get(*args, **kwargs)Get an item from the codelist.
get_codelist()Get the codelist.
get_definition(code)Get the definition for a given code.
get_id()Get a unique id for this codelist.
get_label(code)Get the label for a given code.
Fetch the remote codelist.
get_values()Get the values of the codelist.
is_empty()Check if the codelist is empty.
keys()Get the keys of the dictionary.
parse_codelist_items(codelist)Parse the codelist items from the fetched codelist.
resolve()Resolve the remote codelist values.
values()Get the values of the dictionary.
Initialisation.
- Parameters:
- conceptschemestr
OSLO conceptscheme which will be used for this codelist
- datatypestr
The datatype of the codes of the codelist. One of string, float, integer, date, datetime, boolean.
Methods
add_item(item)Add an item to the codelist.
add_items(items)Add multiple items to the codelist.
Build the SPARQL query to fetch the codelist from DOV.
get(*args, **kwargs)Get an item from the codelist.
get_codelist()Get the codelist.
get_definition(code)Get the definition for a given code.
get_id()Get a unique id for this codelist.
get_label(code)Get the label for a given code.
Fetch the remote codelist.
get_values()Get the values of the codelist.
is_empty()Check if the codelist is empty.
keys()Get the keys of the dictionary.
parse_codelist_items(codelist)Parse the codelist items from the fetched codelist.
resolve()Resolve the remote codelist values.
values()Get the values of the dictionary.
- build_sparql_query()[source]
Build the SPARQL query to fetch the codelist from DOV.
- Returns:
- querystr
The SPARQL query to fetch the codelist.
- get_id()[source]
Get a unique id for this codelist. Needs to be unique among all codelists and will be used for caching.
- Raises:
- NotImplementedError
This is an abstract method that should be implemented in a subclass.
- class pydov.util.codelists.XsdType(xsd_schema, typename, datatype)[source]
Bases:
AbstractResolvableCodeListClass representing a codelist in the XSD format.
Methods
add_item(item)Add an item to the codelist.
add_items(items)Add multiple items to the codelist.
get(*args, **kwargs)Get an item from the codelist.
get_codelist()Get the codelist.
get_definition(code)Get the definition for a given code.
get_id()Get a unique id for this codelist.
get_label(code)Get the label for a given code.
Fetch the remote codelist.
get_values()Get the values of the codelist.
is_empty()Check if the codelist is empty.
keys()Get the keys of the dictionary.
parse_codelist_items(codelist)Parse the codelist items from the fetched codelist.
resolve()Resolve the remote codelist values.
values()Get the values of the dictionary.
Initialise a XSD type reference.
- Parameters:
- xsd_schemastr
URL of XSD schema record containing the specified typename.
- typenamestr
Name of the type.
- datatypestr
The datatype of the codes of the codelist. One of string, float, integer, date, datetime, boolean.
Methods
add_item(item)Add an item to the codelist.
add_items(items)Add multiple items to the codelist.
get(*args, **kwargs)Get an item from the codelist.
get_codelist()Get the codelist.
get_definition(code)Get the definition for a given code.
get_id()Get a unique id for this codelist.
get_label(code)Get the label for a given code.
Fetch the remote codelist.
get_values()Get the values of the codelist.
is_empty()Check if the codelist is empty.
keys()Get the keys of the dictionary.
parse_codelist_items(codelist)Parse the codelist items from the fetched codelist.
resolve()Resolve the remote codelist values.
values()Get the values of the dictionary.
- get_id()[source]
Get a unique id for this codelist. Needs to be unique among all codelists and will be used for caching.
- Raises:
- NotImplementedError
This is an abstract method that should be implemented in a subclass.
Wrappers
Module with a class that provides a dictionary-like interface with attribute access.
- class pydov.util.wrappers.AbstractDictLike(base_dict=None)[source]
Bases:
objectA class that provides a dictionary-like interface with attribute access.
Methods
keys()Get the keys of the dictionary.
values()Get the values of the dictionary.
Initialisation.
- Parameters:
- base_dictdict, optional
The base dictionary to wrap. Defaults to None, which means an empty dictionary is used.
Methods
keys()Get the keys of the dictionary.
values()Get the values of the dictionary.
- Raises:
- TypeError
If base_dict is not a dictionary.
Caching
Module implementing a local cache for downloaded XML files.
- class pydov.util.caching.AbstractCache[source]
Bases:
objectAbstract base class for caching of downloaded XML files from DOV.
- Attributes:
- stale_on_errorbool, default to True
Whether to return stale responses from the cache in case of a network error prevents downloading a fresh copy.
Methods
clean()Clean the cache by removing old records from the cache.
get(url[, session])Get the XML data for the DOV object referenced by the given URL.
remove()Remove the entire cache.
Initialisation.
Methods
clean()Clean the cache by removing old records from the cache.
get(url[, session])Get the XML data for the DOV object referenced by the given URL.
remove()Remove the entire cache.
- clean()[source]
Clean the cache by removing old records from the cache.
Since during normal use the cache only grows by adding new objects and overwriting existing ones with a new version, you can use this function to clean the cache. It will remove all records older than the maximum age from the cache.
- get(url, session=None)[source]
Get the XML data for the DOV object referenced by the given URL.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
If a valid version exists in the cache, it will be loaded and returned. If no valid version exists, the XML will be downloaded from the DOV webservice, saved in the cache and returned.
- Parameters:
- urlstr
Permanent URL to a DOV object.
- sessionrequests.Session
Session to use to perform HTTP requests for data. Defaults to None, which means a new session will be created for each request.
- Returns:
- xmlbytes
The raw XML data of this DOV object as bytes.
- class pydov.util.caching.AbstractFileCache(max_age=datetime.timedelta(days=14), cachedir=None)[source]
Bases:
AbstractCacheAbstract class for filebased caching of downloaded XML files from DOV.
Methods
clean()Clean the cache by removing old records from the cache.
get(url[, session])Get the XML data for the DOV object referenced by the given URL.
remove()Remove the entire cache directory.
Initialisation.
Set up the instance variables and create the cache directory if it does not exists already.
- Parameters:
- max_agedatetime.timedelta, optional
The maximum age of a cached XML file to be valid. If the last modification date of the file is before this time, it will be redownloaded. Defaults to two weeks.
- cachedirstr, optional
Path of the directory that will be used to save the cached XML files. Be sure to use a directory that will only be used for this PyDOV cache. Default to a temporary directory provided by the operating system.
Methods
clean()Clean the cache by removing old records from the cache.
get(url[, session])Get the XML data for the DOV object referenced by the given URL.
remove()Remove the entire cache directory.
- clean()[source]
Clean the cache by removing old records from the cache.
Since during normal use the cache only grows by adding new objects and overwriting existing ones with a new version, you can use this function to clean the cache. It will remove all records older than the maximum age from the cache.
Note that this method is currently not called anywhere in the code, but it is provided as reference.
- get(url, session=None)[source]
Get the XML data for the DOV object referenced by the given URL.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
If a valid version exists in the cache, it will be loaded and returned. If no valid version exists, the XML will be downloaded from the DOV webservice, saved in the cache and returned.
- Parameters:
- urlstr
Permanent URL to a DOV object.
- sessionrequests.Session
Session to use to perform HTTP requests for data. Defaults to None, which means a new session will be created for each request.
- Returns:
- xmlbytes
The raw XML data of this DOV object as bytes.
- remove()[source]
Remove the entire cache directory.
Note that the default directory to save the cache is a temporary location provided by the operating system, and as a subsequence the OS will normally take care of its removal.
Note that this method is currently not called anywhere in the code, but it is provided as reference.
- class pydov.util.caching.GzipTextFileCache(max_age=datetime.timedelta(days=14), cachedir=None)[source]
Bases:
AbstractFileCacheClass for GZipped text caching of downloaded XML files from DOV.
Methods
clean()Clean the cache by removing old records from the cache.
get(url[, session])Get the XML data for the DOV object referenced by the given URL.
remove()Remove the entire cache directory.
Initialisation.
Set up the instance variables and create the cache directory if it does not exists already.
- Parameters:
- max_agedatetime.timedelta, optional
The maximum age of a cached XML file to be valid. If the last modification date of the file is before this time, it will be redownloaded. Defaults to two weeks.
- cachedirstr, optional
Path of the directory that will be used to save the cached XML files. Be sure to use a directory that will only be used for this PyDOV cache. Default to a temporary directory provided by the operating system.
Methods
clean()Clean the cache by removing old records from the cache.
get(url[, session])Get the XML data for the DOV object referenced by the given URL.
remove()Remove the entire cache directory.
- class pydov.util.caching.PlainTextFileCache(max_age=datetime.timedelta(days=14), cachedir=None)[source]
Bases:
AbstractFileCacheClass for plain text caching of downloaded XML files from DOV.
Methods
clean()Clean the cache by removing old records from the cache.
get(url[, session])Get the XML data for the DOV object referenced by the given URL.
remove()Remove the entire cache directory.
Initialisation.
Set up the instance variables and create the cache directory if it does not exists already.
- Parameters:
- max_agedatetime.timedelta, optional
The maximum age of a cached XML file to be valid. If the last modification date of the file is before this time, it will be redownloaded. Defaults to two weeks.
- cachedirstr, optional
Path of the directory that will be used to save the cached XML files. Be sure to use a directory that will only be used for this PyDOV cache. Default to a temporary directory provided by the operating system.
Methods
clean()Clean the cache by removing old records from the cache.
get(url[, session])Get the XML data for the DOV object referenced by the given URL.
remove()Remove the entire cache directory.
Hooks
Module implementing a simple hooks system to allow late-binding actions to PyDOV events.
- class pydov.util.hooks.AbstractInjectHook[source]
Bases:
objectAbstract base class for custom hook implementations.
This class contains all inject hooks: i.e. hooks receiving events and possibly returning custom data for injection into pydov’s execution stack.
Inject hooks allow you to capture and intercept remote server calls, influencing pydov’s inner workings. Use with care! If you reached this part of the code, it is probably wise to open an issue in Github, since this is most likely not what you need.
Provides all available methods with a default implementation to do nothing. This allows for hook subclasses to only implement the events they need.
Methods
inject_meta_response(url)Inject a response for a metadata request.
Inject a response for a WFS GetFeature request.
inject_xml_response(pkey_object)Inject a response for a DOV XML request.
- inject_meta_response(url)[source]
Inject a response for a metadata request.
This allows to intercept a metadata request and return a response of your choice.
When at least one registered hook returns a response for a given URL, the remote call is not executed and instead the response from the last registered hook (that is non-null) is used instead.
Metadata calls include amongst others: WFS GetCapabilities, requests for MD_Metadata, FC_FeatureCatalogue and XSD schemas.
These are all calls except for WFS GetFeature requests and XML downloads of DOV data - these are other hooks.
- Parameters:
- urlstr
URL of the metadata request.
- Returns:
- bytes, optional
The response to use in favor of resolving the URL. Return None to disable this inject hook.
- inject_wfs_getfeature_response(query)[source]
Inject a response for a WFS GetFeature request.
This allows to intercept a WFS GetFeature request and return a response of your choice.
When at least one registered hook returns a response for a given query, the remote call is not executed and instead the response from the last registered hook (that is non-null) is used instead.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
- Parameters:
- queryetree.ElementTree
The WFS GetFeature request sent to the WFS server.
- Returns:
- xml: bytes, optional
The GetFeature response to use in favor of resolving the URL. Return None to disable this inject hook.
- inject_xml_response(pkey_object)[source]
Inject a response for a DOV XML request.
This allows to intercept a DOV XML request and return a response of your choice.
When at least one registered hook returns a response for a given pkey, the remote call is not executed and instead the response from the last registered hook (that is non-null) is used instead.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
- Parameters:
- queryetree.ElementTree
The WFS GetFeature request sent to the WFS server.
- Returns:
- xmlbytes, optional
The XML response to use in favor of resolving the URL. Return None to disable this inject hook.
- class pydov.util.hooks.AbstractReadHook[source]
Bases:
objectAbstract base class for custom hook implementations.
This class contains all read-only hooks: i.e. hooks receiving events but otherwise not interfering with pydov’s execution stack.
Provides all available methods with a default implementation to do nothing. This allows for hook subclasses to only implement the events they need.
Methods
meta_received(url, response)Called when a response for a metadata requests is received.
wfs_search_init(params)Called upon starting a WFS search.
wfs_search_result(number_matched, ...)Called after a WFS search query finished.
wfs_search_result_received(query, features)Called after a WFS search finished.
xml_cache_hit(pkey_object)Called when the XML document of an object is retrieved from the cache.
xml_downloaded(pkey_object)Called when the XML document of an object is downloaded from the DOV services.
xml_fetch_error(pkey_object)Called when the XML document of an object failed to be retrieved from the DOV service and no stale version could be returned from the cache.
xml_received(pkey_object, xml)Called when the XML of a given object is received, either from the cache or from the remote DOV service.
xml_stale_hit(pkey_object)Called when the XML document of an object failed to be retrieved from the DOV service and a stale version has been returned from the cache.
- meta_received(url, response)[source]
Called when a response for a metadata requests is received.
Metadata calls include amongst others: WFS GetCapabilities, requests for MD_Metadata, FC_FeatureCatalogue and XSD schemas.
These are all calls except for WFS GetFeature requests and XML downloads of DOV data - these are other hooks.
- Parameters:
- urlstr
URL of the metadata request.
- responsebytes
The raw response as received from resolving the URL.
- wfs_search_init(params)[source]
Called upon starting a WFS search.
- Parameters:
- paramsdict
- Parameters used to initiate WFS search. These include:
- typenamestr
Typename in the WFS service to query.
- locationpydov.util.location.AbstractLocationFilter or None
Location filter limiting the features to retrieve.
- filterstr (xml) or None
Attribute filter limiting the features to retrieve.
- sort_bystr (xml) or None
SortBy clause listing fields to sort by.
- max_featuresint
Limit the maximum number of features to request.
- propertynameslist of str
List of WFS propertynames (attributes) to retrieve.
- geometry_columnstr
Name of the column/attribute containing the geometry.
- wfs_search_result(number_matched, number_returned)[source]
Called after a WFS search query finished.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
- Parameters:
- number_matchedint
The number of features matched by the WFS search query.
- number_returnedint
The number of features returned by the WFS search query. Due to server limitations this can be less than number_matched.
- wfs_search_result_received(query, features)[source]
Called after a WFS search finished.
Includes both the GetFeature query as well as the response from the WFS server.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
- Parameters:
- queryetree.ElementTree
The WFS GetFeature request sent to the WFS server.
- featuresetree.ElementTree
The WFS GetFeature response containings the features.
- xml_cache_hit(pkey_object)[source]
Called when the XML document of an object is retrieved from the cache.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
- Parameters:
- pkey_objectstr
Permanent key of the requested object.
- xml_downloaded(pkey_object)[source]
Called when the XML document of an object is downloaded from the DOV services.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
- Parameters:
- pkey_objectstr
Permanent key of the requested object.
- xml_fetch_error(pkey_object)[source]
Called when the XML document of an object failed to be retrieved from the DOV service and no stale version could be returned from the cache.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
- Parameters:
- pkey_objectstr
Permanent key of the requested object.
- xml_received(pkey_object, xml)[source]
Called when the XML of a given object is received, either from the cache or from the remote DOV service.
Includes the permanent key of the DOV object as well as the full XML representation.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
- Parameters:
- pkey_objectstr
Permanent key of the retrieved object.
- xmlbytes
The raw XML data of this DOV object as bytes.
- xml_stale_hit(pkey_object)[source]
Called when the XML document of an object failed to be retrieved from the DOV service and a stale version has been returned from the cache.
Because of parallel processing, this method will be called simultaneously from multiple threads. Make sure your implementation is threadsafe or uses locking.
- Parameters:
- pkey_objectstr
Permanent key of the requested object.
- class pydov.util.hooks.HookRunner[source]
Bases:
objectClass for executing registered hooks.
Methods
Execute the inject_meta_response method for all registered hooks.
Execute the inject_wfs_getfeature_response method for all registered hooks.
execute_inject_xml_response(pkey_object)Execute the inject_xml_response method for all registered hooks.
execute_meta_received(url, response)Execute the meta_received method for all registered hooks.
execute_wfs_search_init(params)Execute the wfs_search_init method for all registered hooks.
execute_wfs_search_result(number_matched, ...)Execute the wfs_search_result method for all registered hooks.
execute_wfs_search_result_received(query, ...)Execute the wfs_search_result_received method for all registered hooks.
execute_xml_cache_hit(pkey_object)Execute the xml_cache_hit method for all registered hooks.
execute_xml_downloaded(pkey_object)Execute the xml_downloaded method for all registered hooks.
execute_xml_fetch_error(pkey_object)Execute the xml_fetch_error method for all registered hooks.
execute_xml_received(pkey_object, xml)Execute the xml_received method for all registered hooks.
execute_xml_stale_hit(pkey_object)Execute the xml_stale_hit method for all registered hooks.
- static execute_inject_meta_response(url)[source]
Execute the inject_meta_response method for all registered hooks.
- Parameters:
- urlstr
URL of the metadata request.
- Returns:
- bytes, optional
The response to use in favor of resolving the URL. Returns None if this inject hook is unused.
- static execute_inject_wfs_getfeature_response(query)[source]
Execute the inject_wfs_getfeature_response method for all registered hooks.
- Parameters:
- queryetree.ElementTree
The WFS GetFeature request sent to the WFS server.
- Returns:
- xml: bytes, optional
The GetFeature response to use in favor of resolving the URL. Returns None if this inject hook is unused.
- static execute_inject_xml_response(pkey_object)[source]
Execute the inject_xml_response method for all registered hooks.
- Parameters:
- queryetree.ElementTree
The WFS GetFeature request sent to the WFS server.
- Returns:
- xmlbytes, optional
The XML response to use in favor of resolving the URL. Returns None if this inject hook is unused.
- static execute_meta_received(url, response)[source]
Execute the meta_received method for all registered hooks.
- Parameters:
- urlstr
URL of the metadata request.
- responsebytes
The raw response as received from resolving the URL.
- static execute_wfs_search_init(params)[source]
Execute the wfs_search_init method for all registered hooks.
- Parameters:
- paramsdict
- Parameters used to initiate WFS search. These include:
- typenamestr
Typename in the WFS service to query.
- locationpydov.util.location.AbstractLocationFilter or None
Location filter limiting the features to retrieve.
- filterstr (xml) or None
Attribute filter limiting the features to retrieve.
- sort_bystr (xml) or None
SortBy clause listing fields to sort by.
- max_featuresint
Limit the maximum number of features to request.
- propertynameslist of str
List of WFS propertynames (attributes) to retrieve.
- geometry_columnstr
Name of the column/attribute containing the geometry.
- static execute_wfs_search_result(number_matched, number_returned)[source]
Execute the wfs_search_result method for all registered hooks.
- Parameters:
- number_matchedint
The number of features matched by the WFS search query.
- number_returnedint
The number of features returned by the WFS search query. Due to server limitations this can be less than number_matched.
- static execute_wfs_search_result_received(query, features)[source]
Execute the wfs_search_result_received method for all registered hooks.
- Parameters:
- queryetree.ElementTree
The WFS GetFeature request sent to the WFS server.
- featuresetree.ElementTree
The WFS GetFeature response containing the features.
- static execute_xml_cache_hit(pkey_object)[source]
Execute the xml_cache_hit method for all registered hooks.
- Parameters:
- pkey_objectstr
Permanent key of the requested object.
- static execute_xml_downloaded(pkey_object)[source]
Execute the xml_downloaded method for all registered hooks.
- Parameters:
- pkey_objectstr
Permanent key of the requested object.
- static execute_xml_fetch_error(pkey_object)[source]
Execute the xml_fetch_error method for all registered hooks.
- Parameters:
- pkey_objectstr
Permanent key of the requested object.
- class pydov.util.hooks.Hooks(iterable=(), /)[source]
Bases:
listRuntime representation of registered pydov hooks, i.e. a list of instances of AbstractReadHook and/or AbstractInjectHook.
Methods
append(object, /)Append object to the end of the list.
clear(/)Remove all items from list.
copy(/)Return a shallow copy of the list.
count(value, /)Return number of occurrences of value.
extend(iterable, /)Extend list by appending elements from the iterable.
Get the registered inject hooks (i.e. hooks that are subclasses of AbstractInjectHook), in the order they are defined in the list.
Get the registered read hooks (i.e. hooks that are subclasses of AbstractReadHook), in the order they are defined in the list.
index(value[, start, stop])Return first index of value.
insert(index, object, /)Insert object before index.
pop([index])Remove and return item at index (default last).
remove(value, /)Remove first occurrence of value.
reverse(/)Reverse IN PLACE.
sort(*[, key, reverse])Sort the list in ascending order and return None.
- class pydov.util.hooks.RepeatableLogRecorder(log_directory)[source]
Bases:
AbstractReadHook,AbstractInjectHookClass for recording a pydov session into a ZIP archive.
This enables to save (the results of) all metadata and data requests from the DOV services locally on disk.
The saved ZIP archive can subsequently be used in the RepeatableLogReplayer to replay the saved session allowing fully reproducible pydov runs.
Methods
inject_meta_response(url)Inject a response for a metadata request.
Inject a response for a WFS GetFeature request.
inject_xml_response(pkey_object)Inject a response for a DOV XML request.
meta_received(url, response)Called when a response for a metadata requests is received.
wfs_search_init(params)Called upon starting a WFS search.
wfs_search_result(number_matched, ...)Called after a WFS search query finished.
wfs_search_result_received(query, features)Called after a WFS search finished.
xml_cache_hit(pkey_object)Called when the XML document of an object is retrieved from the cache.
xml_downloaded(pkey_object)Called when the XML document of an object is downloaded from the DOV services.
xml_fetch_error(pkey_object)Called when the XML document of an object failed to be retrieved from the DOV service and no stale version could be returned from the cache.
xml_received(pkey_object, xml)Called when the XML of a given object is received, either from the cache or from the remote DOV service.
xml_stale_hit(pkey_object)Called when the XML document of an object failed to be retrieved from the DOV service and a stale version has been returned from the cache.
Initialise a RepeatableLogRecorder hook.
It will save a ZIP archive with the current pydov session’s data in the given log directory.
Replays previously saved responses in the current session too to enable full reproducibility between the session being saved and replays of the saved ZIP archive. When this would be omitted they would not necessarily yield the same results due to timing issues (albeit quite far fetched).
- Parameters:
- log_directorystr
Path to a directory on disk where the ZIP archive containing the pydov session will be saved. Will be created if it does not exist.
Methods
inject_meta_response(url)Inject a response for a metadata request.
Inject a response for a WFS GetFeature request.
inject_xml_response(pkey_object)Inject a response for a DOV XML request.
meta_received(url, response)Called when a response for a metadata requests is received.
wfs_search_init(params)Called upon starting a WFS search.
wfs_search_result(number_matched, ...)Called after a WFS search query finished.
wfs_search_result_received(query, features)Called after a WFS search finished.
xml_cache_hit(pkey_object)Called when the XML document of an object is retrieved from the cache.
xml_downloaded(pkey_object)Called when the XML document of an object is downloaded from the DOV services.
xml_fetch_error(pkey_object)Called when the XML document of an object failed to be retrieved from the DOV service and no stale version could be returned from the cache.
xml_received(pkey_object, xml)Called when the XML of a given object is received, either from the cache or from the remote DOV service.
xml_stale_hit(pkey_object)Called when the XML document of an object failed to be retrieved from the DOV service and a stale version has been returned from the cache.
- inject_meta_response(url)[source]
Inject a response for a metadata request.
Create a stable hash based on the URL and inject a previously saved response if available. If no previous response is available, return None to resume normal pydov flow.
- Parameters:
- urlstr
URL of the metadata request.
- Returns:
- bytes, optional
The response to use in favor of resolving the URL. Returns None if no previously recorded response is available for this request.
- inject_wfs_getfeature_response(query)[source]
Inject a response for a WFS GetFeature request.
Create a stable hash based on the query and inject a previously saved response if available. If no previous response is available, return None to resume normal pydov flow.
- Parameters:
- queryetree.ElementTree
The WFS GetFeature request sent to the WFS server.
- Returns:
- xml: bytes, optional
The GetFeature response to use in favor of resolving the URL. Return None to disable this inject hook.
- inject_xml_response(pkey_object)[source]
Inject a response for a DOV XML request.
Create a stable hash based on the pkey_object and inject a previously saved response if available. If no previous response is available, return None to resume normal pydov flow.
- Parameters:
- pkey_objectstr
The permanent key of the DOV object.
- Returns:
- xmlbytes, optional
The XML response to use in favor of resolving the URL. Return None to disable this inject hook.
- meta_received(url, response)[source]
Called when a response for a metadata requests is received.
Create a stable hash based on the URL and archive the response.
- Parameters:
- urlstr
URL of the metadata request.
- responsebytes
The raw response as received from resolving the URL.
- wfs_search_result_received(query, features)[source]
Called after a WFS search finished.
Create a stable hash based on the query and archive the feature response.
- Parameters:
- queryetree.ElementTree
The WFS GetFeature request sent to the WFS server.
- featuresetree.ElementTree
The WFS GetFeature response containings the features.
- xml_received(pkey_object, xml)[source]
Called when the XML of a given object is received, either from the cache or from the remote DOV service.
Create a stable hash based on the pkey_object and archive the xml response.
- Parameters:
- pkey_objectstr
Permanent key of the retrieved object.
- xmlbytes
The raw XML data of this DOV object as bytes.
- class pydov.util.hooks.RepeatableLogReplayer(log_archive)[source]
Bases:
AbstractInjectHookClass for replaying a saved pydov session from a ZIP archive.
This will reroute all external requests to the saved results in the ZIP archive, enabling fully reproducable pydov runs.
Methods
inject_meta_response(url)Inject a response for a metadata request.
Inject a response for a WFS GetFeature request.
inject_xml_response(pkey_object)Inject a response for a DOV XML request.
Initialise a RepeatableLogReplayer hook.
It will reroute all external requests to the saved results in the given ZIP archive.
- Parameters:
- log_archivestr
Path to the ZIP archive to use for replay.
Methods
inject_meta_response(url)Inject a response for a metadata request.
Inject a response for a WFS GetFeature request.
inject_xml_response(pkey_object)Inject a response for a DOV XML request.
- inject_meta_response(url)[source]
Inject a response for a metadata request.
Create a stable hash based on the URL and inject the previously saved response.
- Parameters:
- urlstr
URL of the metadata request.
- Returns:
- bytes, optional
The response to use in favor of resolving the URL.
- Raises:
- pydov.util.errors.LogReplayError
When the response required for this URL could not be found in the archive. This happens for instance when replaying an archive for a different pydov session than the one it was saved for.
- inject_wfs_getfeature_response(query)[source]
Inject a response for a WFS GetFeature request.
Create a stable hash based on the query and inject the previously saved response.
- Parameters:
- queryetree.ElementTree
The WFS GetFeature request sent to the WFS server.
- Returns:
- xml: bytes, optional
The GetFeature response to use in favor of resolving the URL.
- Raises:
- pydov.util.errors.LogReplayError
When the response required for this URL could not be found in the archive. This happens for instance when replaying an archive for a different pydov session than the one it was saved for.
- inject_xml_response(pkey_object)[source]
Inject a response for a DOV XML request.
Create a stable hash based on the pkey_object and inject the previously saved response.
- Parameters:
- pkey_objectstr
The permanent key of the DOV object.
- Returns:
- xmlbytes, optional
The XML response to use in favor of resolving the URL. Return None to disable this inject hook.
- Raises:
- pydov.util.errors.LogReplayError
When the response required for this URL could not be found in the archive. This happens for instance when replaying an archive for a different pydov session than the one it was saved for.
- class pydov.util.hooks.SimpleStatusHook[source]
Bases:
AbstractReadHookSimple hook implementation to print progress to stdout.
Methods
Simple class for storing progress state.
meta_received(url, response)Called when a response for a metadata requests is received.
wfs_search_init(params)When a new WFS search is started, reset all counters to 0 and set the maximum requested results.
wfs_search_result(number_matched, ...)When the WFS search completes, set the total result count.
wfs_search_result_received(query, features)Called after a WFS search finished.
xml_cache_hit(pkey_object)When an XML document is retrieved from the cache, print 'c' to the progress output.
xml_downloaded(pkey_object)When an XML document is downloaded from the DOV services, print '.' to the progress output.
xml_fetch_error(pkey_object)When an XML document failed to be fetched from DOV, print 'E' to the progress output.
xml_received(pkey_object, xml)Called when the XML of a given object is received, either from the cache or from the remote DOV service.
xml_stale_hit(pkey_object)When a stale XML document is retrieved from the cache, print 'S' to the progress output.
Initialisation.
Initialise all variables to default.
Methods
Simple class for storing progress state.
meta_received(url, response)Called when a response for a metadata requests is received.
wfs_search_init(params)When a new WFS search is started, reset all counters to 0 and set the maximum requested results.
wfs_search_result(number_matched, ...)When the WFS search completes, set the total result count.
wfs_search_result_received(query, features)Called after a WFS search finished.
xml_cache_hit(pkey_object)When an XML document is retrieved from the cache, print 'c' to the progress output.
xml_downloaded(pkey_object)When an XML document is downloaded from the DOV services, print '.' to the progress output.
xml_fetch_error(pkey_object)When an XML document failed to be fetched from DOV, print 'E' to the progress output.
xml_received(pkey_object, xml)Called when the XML of a given object is received, either from the cache or from the remote DOV service.
xml_stale_hit(pkey_object)When a stale XML document is retrieved from the cache, print 'S' to the progress output.
- class ProgressState[source]
Bases:
objectSimple class for storing progress state.
Methods
reset()Reset the progress state.
Initialise a new progress state, with all variable to default.
Methods
reset()Reset the progress state.
- wfs_search_init(params)[source]
When a new WFS search is started, reset all counters to 0 and set the maximum requested results.
- Parameters:
- paramsdict
- Parameters used to initiate WFS search. These include:
- typenamestr
Typename in the WFS service to query.
- locationpydov.util.location.AbstractLocationFilter or None
Location filter limiting the features to retrieve.
- filterstr (xml) or None
Attribute filter limiting the features to retrieve.
- sort_bystr (xml) or None
SortBy clause listing fields to sort by.
- max_featuresint or None
Limit the maximum number of features to request.
- propertynameslist of str
List of WFS propertynames (attributes) to retrieve.
- geometry_columnstr
Name of the column/attribute containing the geometry.
- wfs_search_result(number_matched, number_returned)[source]
When the WFS search completes, set the total result count.
- Parameters:
- number_matchedint
The number of features matched by the WFS search query.
- number_returnedint
The number of features returned by the WFS search query. Due to server limitations this can be less than number_matched.
- xml_cache_hit(pkey_object)[source]
When an XML document is retrieved from the cache, print ‘c’ to the progress output.
- Parameters:
- pkey_objectstr
Permanent key of the requested object.
- xml_downloaded(pkey_object)[source]
When an XML document is downloaded from the DOV services, print ‘.’ to the progress output.
- Parameters:
- pkey_objectstr
Permanent key of the requested object.
Network utilities
Module grouping network-related utilities and functions.
- class pydov.util.net.LocalSessionThread(input_queue)[source]
Bases:
ThreadWorker thread using a local Session to execute functions.
- Attributes:
daemonA boolean value indicating whether this thread is a daemon thread.
identThread identifier of this thread or None if it has not been started.
nameA string used for identification purposes only.
native_idNative integral thread ID of this thread, or None if it has not been started.
Methods
getName()Return a string used for identification purposes only.
isDaemon()Return whether this thread is a daemon.
is_alive()Return whether the thread is alive.
join([timeout])Wait until the thread terminates.
run()Executed while the thread is running.
setDaemon(daemonic)Set whether this thread is a daemon.
setName(name)Set the name string for this thread.
start()Start the thread's activity.
stop()Stop the worker thread at the next occasion.
Initialisation.
Bind to the input queue and create a Session.
- Parameters:
- input_queuequeue.Queue
Queue to poll for input, this should be in the form of a tuple with 3 items: function to call, list with arguments and WorkerResult instance to store the output. The list with arguments will be automatically extended with the local Session instance.
- Attributes:
daemonA boolean value indicating whether this thread is a daemon thread.
identThread identifier of this thread or None if it has not been started.
nameA string used for identification purposes only.
native_idNative integral thread ID of this thread, or None if it has not been started.
Methods
getName()Return a string used for identification purposes only.
isDaemon()Return whether this thread is a daemon.
is_alive()Return whether the thread is alive.
join([timeout])Wait until the thread terminates.
run()Executed while the thread is running.
setDaemon(daemonic)Set whether this thread is a daemon.
setName(name)Set the name string for this thread.
start()Start the thread's activity.
stop()Stop the worker thread at the next occasion.
- class pydov.util.net.LocalSessionThreadPool(workers=4)[source]
Bases:
objectThread pool of LocalSessionThreads used to perform HTTP I/O operations in parallel.
Methods
execute(fn, args)Execute the given function with its arguments in a worker thread.
join()Wait for all the jobs to be executed and return the results of all jobs in a list.
stop()Stop all worker threads.
Initialisation.
Set up the pool and start all workers.
- Parameters:
- workersint, optional
Number of worker threads to use, defaults to 4.
Methods
execute(fn, args)Execute the given function with its arguments in a worker thread.
join()Wait for all the jobs to be executed and return the results of all jobs in a list.
stop()Stop all worker threads.
- execute(fn, args)[source]
Execute the given function with its arguments in a worker thread.
This will add the job to the queue and will not wait for the result. Use join() to retrieve the result.
- Parameters:
- fnfunction
Function to execute. It should take all arguments from args, and after that a single argument with the requests Session.
- argstuple
Arguments that will be passed to the function.
- class pydov.util.net.SessionFactory[source]
Bases:
objectClass for generating pydov configured requests Sessions. They are used to send HTTP requests using our user-agent and with added retry-logic.
One global session is used for all requests, and additionally one session is used per thread executing XML requests in parallel.
Methods
Request a new session without retry-logic or timeout.
Request a new session.
set_user_agent(session)Set the pydov user-agent header for the given session.
- static get_fail_fast_session()[source]
Request a new session without retry-logic or timeout.
- Returns:
- requests.Session
requests Session with pydov user-agent header.
- class pydov.util.net.TimeoutHTTPAdapter(*args, **kwargs)[source]
Bases:
HTTPAdapterHTTPAdapter which adds a default timeout to requests. Allows timeout to be overridden on a per-request basis.
Methods
add_headers(request, **kwargs)Add any headers needed by the connection.
build_connection_pool_key_attributes(...[, cert])Build the PoolKey attributes used by urllib3 to return a connection.
build_response(req, resp)Builds a
Responseobject from a urllib3 response.cert_verify(conn, url, verify, cert)Verify a SSL certificate.
close()Disposes of any internal state.
get_connection(url[, proxies])DEPRECATED: Users should move to get_connection_with_tls_context for all subclasses of HTTPAdapter using Requests>=2.32.2.
get_connection_with_tls_context(request, verify)Returns a urllib3 connection for the given request and TLS settings.
init_poolmanager(connections, maxsize[, block])Initializes a urllib3 PoolManager.
proxy_headers(proxy)Returns a dictionary of the headers to add to any request sent through a proxy.
proxy_manager_for(proxy, **proxy_kwargs)Return urllib3 ProxyManager for the given proxy.
request_url(request, proxies)Obtain the url to use when making the final request.
send(request, **kwargs)Sends PreparedRequest object.
Initialisation.
Methods
add_headers(request, **kwargs)Add any headers needed by the connection.
build_connection_pool_key_attributes(...[, cert])Build the PoolKey attributes used by urllib3 to return a connection.
build_response(req, resp)Builds a
Responseobject from a urllib3 response.cert_verify(conn, url, verify, cert)Verify a SSL certificate.
close()Disposes of any internal state.
get_connection(url[, proxies])DEPRECATED: Users should move to get_connection_with_tls_context for all subclasses of HTTPAdapter using Requests>=2.32.2.
get_connection_with_tls_context(request, verify)Returns a urllib3 connection for the given request and TLS settings.
init_poolmanager(connections, maxsize[, block])Initializes a urllib3 PoolManager.
proxy_headers(proxy)Returns a dictionary of the headers to add to any request sent through a proxy.
proxy_manager_for(proxy, **proxy_kwargs)Return urllib3 ProxyManager for the given proxy.
request_url(request, proxies)Obtain the url to use when making the final request.
send(request, **kwargs)Sends PreparedRequest object.
- class pydov.util.net.WorkerResult[source]
Bases:
objectClass for storing the result of a job execution in the result queue.
This allows putting a result instance in the queue on job submission and fill in the result later when the job completes. This ensures the result output is in the same order as the jobs were submitted.
Methods
Retrieve the error, if any, of this job.
Retrieve the result of this job.
set_error(error)Set the error, in case the jobs fails with an exception.
set_result(value)Set the result of this job.
Initialisation.
Methods
Retrieve the error, if any, of this job.
Retrieve the result of this job.
set_error(error)Set the error, in case the jobs fails with an exception.
set_result(value)Set the result of this job.
- get_error()[source]
Retrieve the error, if any, of this job.
- Returns:
- Exception
The exception raised while executing this job.
- get_result()[source]
Retrieve the result of this job.
- Returns:
- any
The result of the execution of the job.
- pydov.util.net.proxy_autoconfiguration()[source]
Try proxy autoconfiguration via PAC.
This function tries to autodetect the required proxy server using PAC, and sets the HTTP_PROXY and HTTPS_PROXY environment variables accordingly.
These variables should subsequently be picked up by the requests sessions used by pydov and owslib.
Errors and warnings
Module grouping Exception classes.
- exception pydov.util.errors.CodelistFetchWarning[source]
Bases:
DOVWarningEmitted when a codelist fails to be fetched from the DOV webservice, resulting in the fields metadata to be incomplete.
- exception pydov.util.errors.DataParseWarning[source]
Bases:
DOVWarningEmitted when some data retrieved from DOV failed to be parsed according to the datatypes in pydov. The data that failed to be parsed is removed, resulting in an incomplete dataframe.
- exception pydov.util.errors.InvalidFieldError[source]
Bases:
DOVErrorError that occurs when using a field outside its scope.
- exception pydov.util.errors.InvalidSearchParameterError[source]
Bases:
DOVErrorError that occurs when given invalid parameters to the DOV search.
- exception pydov.util.errors.LayerNotFoundError[source]
Bases:
OWSErrorError that occurs when a specific layer could not be found.
- exception pydov.util.errors.RemoteFetchError[source]
Bases:
DOVErrorGeneral error while fetching remote data from DOV webservices.
- exception pydov.util.errors.WfsGetFeatureError[source]
Bases:
OWSErrorError that occurs when requesting features using WFS GetFeature.
- exception pydov.util.errors.XmlFetchWarning[source]
Bases:
DOVWarningEmitted when an XML document fails to be fetched from the DOV webservice, resulting in an incomplete dataframe.
- exception pydov.util.errors.XmlParseError[source]
Bases:
DOVErrorError that occurs when the parsing of a DOV XML document failed.
- exception pydov.util.errors.XmlParseWarning[source]
Bases:
DOVWarningEmitted when the failure to parse an XML document results in an incomplete dataframe.
- exception pydov.util.errors.XmlStaleWarning[source]
Bases:
DOVWarningEmitted when an XML document fails to be fetched from the DOV webservice and an older stale version is used from the cache, resulting in an out-of-date dataframe.
- class pydov.util.deprecation.DeprecatedModule(name, message)[source]
Bases:
objectA placeholder module that raises a ModuleNotFoundError upon attribute access.
This class is used to replace deprecated modules. When an attempt is made to access any attribute of a deprecated module, a ModuleNotFoundError is raised with a custom message.
- Parameters:
- namestr
The name of the deprecated module.
- messagestr
The deprecation message to be displayed when the module is accessed. This message should contain the placeholder
{name}which will be replaced by the module’s name.
Initialise the DeprecatedModule.
- Parameters:
- namestr
The name of the deprecated module.
- messagestr
The deprecation message to be displayed when the module is accessed. This message should contain the placeholder
{name}which will be replaced by the module’s name.