API Documentation¶
Client module¶
This module contains utility functions for interacting with AGIV SOAP services.
New in version 0.1.0.
-
crabpy.client.
crab_factory
(**kwargs)[source]¶ Factory that generates a CRAB client.
A few parameters will be handled by the factory, other parameters will be passed on to the client.
Parameters: - wsdl – Optional. Allows overriding the default CRAB wsdl url.
- proxy – Optional. A dictionary of proxy information that is passed
to the underlying
suds.client.Client
Return type: suds.client.Client
Crab gateway module¶
This module contains an opionated gateway for the crab webservice.
New in version 0.3.0.
-
class
crabpy.gateway.crab.
Aardadres
(id, naam, definitie, **kwargs)[source]¶ The nature of an address.
-
class
crabpy.gateway.crab.
Aardgebouw
(id, naam, definitie, **kwargs)[source]¶ The nature of a building.
-
class
crabpy.gateway.crab.
Aardsubadres
(id, naam, definitie, **kwargs)[source]¶ The nature of a subaddress.
-
class
crabpy.gateway.crab.
Aardterreinobject
(id, naam, definitie, **kwargs)[source]¶ The nature of a terreinobject.
-
class
crabpy.gateway.crab.
Aardwegobject
(id, naam, definitie, **kwargs)[source]¶ The nature of a wegobject.
-
class
crabpy.gateway.crab.
Adrespositie
(id, herkomst, geometrie=None, aard=None, metadata=None, **kwargs)[source]¶ The position of an Adres.
This can be used for the position of both
Huisnummer
andSubadres
.A Huisnummer or Subadres, can have more than one Adrespositie, each offering a different interpretation of the position of the Adres. See the herkomst and aard of each Adrespositie to know which one to pick.
-
class
crabpy.gateway.crab.
CrabGateway
(client, **kwargs)[source]¶ A gateway to the CRAB webservice.
-
get_adrespositie_by_id
(id)[source]¶ Retrieve a Adrespositie by the Id.
Parameters: id (integer) – the Id of the Adrespositie Return type: Adrespositie
-
get_deelgemeente_by_id
(id)[source]¶ Retrieve a deelgemeente by the id.
Parameters: id (string) – The id of the deelgemeente. Return type: Deelgemeente
-
get_gebouw_by_id
(id)[source]¶ Retrieve a Gebouw by the Id.
Parameters: id (integer) – the Id of the Gebouw Return type: Gebouw
-
get_gemeente_by_id
(id)[source]¶ Retrieve a gemeente by the crab id.
Parameters: id (integer) – The CRAB id of the gemeente. Return type: Gemeente
-
get_gemeente_by_niscode
(niscode)[source]¶ Retrieve a gemeente by the NIScode.
Parameters: niscode (integer) – The NIScode of the gemeente. Return type: Gemeente
-
get_gewest_by_id
(id)[source]¶ Get a gewest by id.
Parameters: id (integer) – The id of a gewest. Return type: A Gewest
.
-
get_huisnummer_by_id
(id)[source]¶ Retrieve a huisnummer by the Id.
Parameters: id (integer) – the Id of the huisnummer Return type: Huisnummer
-
get_huisnummer_by_nummer_and_straat
(nummer, straat)[source]¶ Retrieve a huisnummer by the nummer and straat
Parameters: - nummer (integer) – The huisnummer of the ‘huisnummer`
- straat – The
Straat
in which the huisnummer is situated.
Return type:
-
get_perceel_by_id
(id)[source]¶ Retrieve a Perceel by the Id.
Parameters: id (string) – the Id of the Perceel Return type: Perceel
-
get_postadres_by_huisnummer
(huisnummer)[source]¶ Get the postadres for a
Huisnummer
.Parameters: huisnummer – The Huisnummer
for which the postadres is wanted. OR A huisnummer id.Return type: A str
.
-
get_postadres_by_subadres
(subadres)[source]¶ Get the postadres for a
Subadres
.Parameters: subadres – The Subadres
for which the postadres is wanted. OR A subadres id.Return type: A str
.
-
get_postkanton_by_huisnummer
(huisnummer)[source]¶ Retrieve a postkanton by the Huisnummer.
Parameters: huisnummer – The Huisnummer
for which the postkanton is wanted.Return type: Postkanton
-
get_provincie_by_id
(niscode)[source]¶ Retrieve a provincie by the niscode.
Parameters: niscode (integer) – The niscode of the provincie. Return type: Provincie
-
get_straat_by_id
(id)[source]¶ Retrieve a straat by the Id.
Parameters: id (integer) – The id of the straat. Return type: Straat
-
get_subadres_by_id
(id)[source]¶ Retrieve a Subadres by the Id.
Parameters: id (integer) – the Id of the Subadres Return type: Subadres
-
get_terreinobject_by_id
(id)[source]¶ Retrieve a Terreinobject by the Id.
Parameters: id (integer) – the Id of the Terreinobject Return type: Terreinobject
-
get_wegobject_by_id
(id)[source]¶ Retrieve a Wegobject by the Id.
Parameters: id (integer) – the Id of the Wegobject Return type: Wegobject
-
get_wegsegment_by_id
(id)[source]¶ Retrieve a wegsegment by the Id.
Parameters: id (integer) – the Id of the wegsegment Return type: Wegsegment
-
list_aardgebouwen
(sort=1)[source]¶ List all aardgebouwen.
Return type: A list
ofAardgebouw
-
list_aardsubadressen
(sort=1)[source]¶ List all aardsubadressen.
Return type: A list
ofAardsubadres
-
list_aardterreinobjecten
(sort=1)[source]¶ List all aardterreinobjecten.
Return type: A list
ofAardterreinobject
-
list_aardwegobjecten
(sort=1)[source]¶ List all aardwegobjecten.
Return type: A list
ofAardwegobject
-
list_adresposities_by_huisnummer
(huisnummer)[source]¶ List all adresposities for a
Huisnummer
.Parameters: huisnummer – The Huisnummer
for which the adresposities are wanted. OR A huisnummer id.Return type: A list
ofAdrespositie
-
list_adresposities_by_nummer_and_straat
(nummer, straat)[source]¶ List all adresposities for a huisnummer and a
Straat
.Parameters: - nummer – A string representing a certain huisnummer.
- straat – The
Straat
for which the adresposities are wanted. OR A straat id.
Return type: A
list
ofAdrespositie
-
list_adresposities_by_subadres
(subadres)[source]¶ List all adresposities for a
Subadres
.Parameters: subadres – The Subadres
for which the adresposities are wanted. OR A subadres id.Return type: A list
ofAdrespositie
-
list_adresposities_by_subadres_and_huisnummer
(subadres, huisnummer)[source]¶ List all adresposities for a subadres and a
Huisnummer
.Parameters: - subadres – A string representing a certain subadres.
- huisnummer – The
Huisnummer
for which the adresposities are wanted. OR A huisnummer id.
Return type: A
list
ofAdrespositie
-
list_deelgemeenten
(gewest=2)[source]¶ List all deelgemeenten in a gewest.
Parameters: gewest – The Gewest
for which the deelgemeenten are wanted. Currently only Flanders is supported.Return type: A list
ofDeelgemeente
.
-
list_deelgemeenten_by_gemeente
(gemeente)[source]¶ List all deelgemeenten in a gemeente.
Parameters: gemeente – The Gemeente
for which the deelgemeenten are wanted. Currently only Flanders is supported.Return type: A list
ofDeelgemeente
.
-
list_gebouwen_by_huisnummer
(huisnummer)[source]¶ List all gebouwen for a
Huisnummer
.Parameters: huisnummer – The Huisnummer
for which the gebouwen are wanted.Return type: A list
ofGebouw
-
list_gemeenten
(gewest=2, sort=1)[source]¶ List all gemeenten in a gewest.
Parameters: - gewest – The
Gewest
for which the gemeenten are wanted. - sort (integer) – What field to sort on.
Return type: - gewest – The
-
list_gemeenten_by_provincie
(provincie)[source]¶ List all gemeenten in a provincie.
Parameters: provincie – The Provincie
for which the gemeenten are wanted.Return type: A list
ofGemeente
.
-
list_geometriemethodegebouwen
(sort=1)[source]¶ List all geometriegebouwen.
Return type: A list
ofGeometriegebouw
-
list_geometriemethodewegsegmenten
(sort=1)[source]¶ List all geometriemethodewegsegmenten.
Return type: A list
ofGeometriemethodewegsegment
-
list_gewesten
(sort=1)[source]¶ List all gewesten in Belgium.
Parameters: sort (integer) – What field to sort on. Return type: A :class`list` of class: Gewest.
-
list_herkomstadresposities
(sort=1)[source]¶ List all herkomstadresposities.
Return type: A list
ofHerkomstadrespositie
-
list_huisnummers_by_perceel
(perceel, sort=1)[source]¶ List all huisnummers on a Pereel.
Generally there will only be one, but multiples are possible.
Parameters: perceel – The Perceel
for which the huisnummers are wanted.Return type: A :class: list of Huisnummer
-
list_huisnummers_by_straat
(straat, sort=1)[source]¶ List all huisnummers in a Straat.
Parameters: straat – The Straat
for which the huisnummers are wanted.Return type: A :class: list of Huisnummer
-
list_organisaties
(sort=1)[source]¶ List all organisaties.
Return type: A list
ofOrganisatie
-
list_percelen_by_huisnummer
(huisnummer)[source]¶ List all percelen for a
Huisnummer
Parameters: huisnummer – The Huisnummer
for which the percelen are wanted.Return type: A list
ofPerceel
-
list_postkantons_by_gemeente
(gemeente)[source]¶ List all postkantons in a
Gemeente
Parameters: gemeente – The Gemeente
for which the potkantons are wanted.Return type: A list
ofPostkanton
-
list_provincies
(gewest=2)[source]¶ List all provincies in a gewest.
Parameters: - gewest – The
Gewest
for which the provincies are wanted. - sort (integer) – What field to sort on.
Return type: - gewest – The
-
list_statushuisnummers
(sort=1)[source]¶ List all statushuisnummers.
Return type: A list
ofStatushuisnummer
-
list_statusstraatnamen
(sort=1)[source]¶ List all statusstraatnamen.
Return type: A list
ofStatusstraatnaam
-
list_statussubadressen
(sort=1)[source]¶ List all statussubadressen.
Return type: A list
ofStatussubadres
-
list_statuswegsegmenten
(sort=1)[source]¶ List all statuswegsegmenten.
Return type: A list
ofStatuswegsegment
-
list_straten
(gemeente, sort=1)[source]¶ List all straten in a Gemeente.
Parameters: gemeente – The Gemeente
for which the straten are wanted.Return type: A list
ofStraat
-
list_subadressen_by_huisnummer
(huisnummer)[source]¶ List all subadressen for a
Huisnummer
.Parameters: huisnummer – The Huisnummer
for which the subadressen are wanted. OR A huisnummer id.Return type: A list
ofGebouw
-
list_terreinobjecten_by_huisnummer
(huisnummer)[source]¶ List all terreinobjecten for a
Huisnummer
Parameters: huisnummer – The Huisnummer
for which the terreinobjecten are wanted.Return type: A list
ofTerreinobject
-
-
class
crabpy.gateway.crab.
Deelgemeente
(id, naam, gemeente_niscode, **kwargs)[source]¶ A subdivision of a
Gemeente
.New in version 0.7.0.
-
set_gateway
(gateway)[source]¶ Parameters: gateway (crabpy.gateway.crab.CrabGateway) – Gateway to use.
-
-
class
crabpy.gateway.crab.
GatewayObject
(**kwargs)[source]¶ Abstract class for objects that are able to use a
crabpy.Gateway.CrabGateway
to find further information.-
gateway
= None¶ The
crabpy.gateway.crab.CrabGateway
to use when making further calls to the CRAB service.
-
set_gateway
(gateway)[source]¶ Parameters: gateway (crabpy.gateway.crab.CrabGateway) – Gateway to use.
-
-
class
crabpy.gateway.crab.
Gebouw
(id, aard, status, methode=None, geometrie=None, metadata=None, **kwargs)[source]¶ A building.
-
class
crabpy.gateway.crab.
Gemeente
(id, naam, niscode, gewest, taal=None, centroid=None, bounding_box=None, metadata=None, **kwargs)[source]¶ The smallest administrative unit in Belgium.
-
set_gateway
(gateway)[source]¶ Parameters: gateway (crabpy.gateway.crab.CrabGateway) – Gateway to use.
-
-
class
crabpy.gateway.crab.
Geometriemethodegebouw
(id, naam, definitie, **kwargs)[source]¶ The geometry method of a
Gebouw
.
-
class
crabpy.gateway.crab.
Geometriemethodewegsegment
(id, naam, definitie, **kwargs)[source]¶ The geometry method of a
Wegsegment
.
-
class
crabpy.gateway.crab.
Gewest
(id, namen=None, centroid=None, bounding_box=None, **kwargs)[source]¶ A large administrative unit in Belgium.
Belgium consists of 3 gewesten. Together they form the entire territory of the country.
-
class
crabpy.gateway.crab.
Herkomstadrespositie
(id, naam, definitie, **kwargs)[source]¶ The origin of an Adressposition.
-
class
crabpy.gateway.crab.
Huisnummer
(id, status, huisnummer, straat_id, metadata=None, **kwargs)[source]¶ A house number.
This is mainly a combination of a street and a house number.
-
class
crabpy.gateway.crab.
Metadata
(begin_datum, begin_tijd, begin_bewerking, begin_organisatie, **kwargs)[source]¶ Metadata about a straat, huisnummer, …
Some of the metadata available is the datum the object was created, the organisation that created it and the type of creation.
-
class
crabpy.gateway.crab.
Organisatie
(id, naam, definitie, **kwargs)[source]¶ An organisation that played a role in the genessis of an object.
-
class
crabpy.gateway.crab.
Perceel
(id, centroid=None, metadata=None, **kwargs)[source]¶ A cadastral Parcel.
A
Terreinobject
is somewhat different from aPerceel
in the source of the data and the information provided. eg. A terreinobject has a centroid and a bounding box, while a perceel also has the centroid, but not the bounding box.
-
class
crabpy.gateway.crab.
Postkanton
(id, **kwargs)[source]¶ A postal code.
Eg. postal code 9000 for the city of Ghent.
-
class
crabpy.gateway.crab.
Provincie
(niscode, naam, gewest, **kwargs)[source]¶ The largest administrative unit within a
Gewest
.New in version 0.4.0.
-
set_gateway
(gateway)[source]¶ Parameters: gateway (crabpy.gateway.crab.CrabGateway) – Gateway to use.
-
-
class
crabpy.gateway.crab.
Statusgebouw
(id, naam, definitie, **kwargs)[source]¶ The current state of a
Gebouw
.
-
class
crabpy.gateway.crab.
Statushuisnummer
(id, naam, definitie, **kwargs)[source]¶ The current state of a huisnummer.
-
class
crabpy.gateway.crab.
Statusstraatnaam
(id, naam, definitie, **kwargs)[source]¶ The current state of a straatnaam.
-
class
crabpy.gateway.crab.
Statussubadres
(id, naam, definitie, **kwargs)[source]¶ The current state of a subadres.
-
class
crabpy.gateway.crab.
Statuswegsegment
(id, naam, definitie, **kwargs)[source]¶ The current state of a wegsegment.
-
class
crabpy.gateway.crab.
Straat
(id, label, gemeente_id, status, straatnaam, taalcode, straatnaam2, taalcode2, metadata=None, **kwargs)[source]¶ A street.
A street object is always located in one and exactly one
Gemeente
.
-
class
crabpy.gateway.crab.
Subadres
(id, subadres, status, huisnummer_id=None, aard=None, metadata=None, **kwargs)[source]¶ An address within a certain
Huisnummer
.These can eg. be postboxes within an appartment complex.
-
class
crabpy.gateway.crab.
Terreinobject
(id, aard, centroid=None, bounding_box=None, metadata=None, **kwargs)[source]¶ A cadastral parcel.
A
Terreinobject
is somewhat different from aPerceel
in the source of the data and the information provided. eg. A terreinobject has a centroid and a bounding box, while a perceel also has the centroid, but not the bounding box.
-
class
crabpy.gateway.crab.
Wegobject
(id, aard, centroid=None, bounding_box=None, metadata=None, **kwargs)[source]¶
-
class
crabpy.gateway.crab.
Wegsegment
(id, status, methode=None, geometrie=None, metadata=None, **kwargs)[source]¶
-
crabpy.gateway.crab.
check_lazy_load_adrespositie
(f)[source]¶ Decorator function to lazy load a
Adrespositie
.
-
crabpy.gateway.crab.
check_lazy_load_gemeente
(f)[source]¶ Decorator function to lazy load a
Gemeente
.
-
crabpy.gateway.crab.
check_lazy_load_huisnummer
(f)[source]¶ Decorator function to lazy load a
Huisnummer
.
-
crabpy.gateway.crab.
check_lazy_load_subadres
(f)[source]¶ Decorator function to lazy load a
Subadres
.
-
crabpy.gateway.crab.
check_lazy_load_terreinobject
(f)[source]¶ Decorator function to lazy load a
Terreinobject
.
-
crabpy.gateway.crab.
check_lazy_load_wegobject
(f)[source]¶ Decorator function to lazy load a
Wegobject
.
-
crabpy.gateway.crab.
check_lazy_load_wegsegment
(f)[source]¶ Decorator function to lazy load a
Wegsegment
.
-
crabpy.gateway.crab.
crab_gateway_request
(client, method, *args)[source]¶ Utility function that helps making requests to the CRAB service.
This is a specialised version of
crabpy.client.crab_request()
that allows adding extra functionality for the calls made by the gateway.Parameters: - client – A
suds.client.Client
for the CRAB service. - action (string) – Which method to call, eg. ListGewesten
Returns: Result of the SOAP call.
- client – A
Capakey gateway module¶
This module contains an opionated gateway for the capakey webservice.
New in version 0.2.0.
-
class
crabpy.gateway.capakey.
Afdeling
(id, naam=None, gemeente=None, centroid=None, bounding_box=None, shape=None, **kwargs)[source]¶ A Cadastral Division of a
Gemeente
.
-
class
crabpy.gateway.capakey.
CapakeyRestGateway
(**kwargs)[source]¶ A REST gateway to the capakey webservice.
New in version 0.8.0.
-
get_kadastrale_afdeling_by_id
(aid)[source]¶ Retrieve a ‘kadastrale afdeling’ by id.
Parameters: aid – An id of a kadastrale afdeling. Return type: A Afdeling
.
-
get_perceel_by_capakey
(capakey)[source]¶ Get a perceel.
Parameters: capakey – An capakey for a perceel. Return type: Perceel
-
get_perceel_by_coordinates
(x, y)[source]¶ Get a perceel.
Parameters: capakey – An capakey for a perceel. Return type: Perceel
-
get_perceel_by_id_and_sectie
(id, sectie)[source]¶ Get a perceel.
Parameters: - id – An id for a perceel.
- sectie – The
Sectie
that contains the perceel.
Return type:
-
get_perceel_by_percid
(percid)[source]¶ Get a perceel.
Parameters: percid – A percid for a perceel. Return type: Perceel
-
get_sectie_by_id_and_afdeling
(id, afdeling)[source]¶ Get a sectie.
Parameters: - id – An id of a sectie. eg. “A”
- afdeling – The
Afdeling
for in which the sectie can be found. Can also be the id of and afdeling.
Return type: A
Sectie
.
-
list_gemeenten
(sort=1)[source]¶ List all gemeenten in Vlaanderen.
Parameters: sort (integer) – What field to sort on. Return type: A list
ofGemeente
.
-
list_kadastrale_afdelingen
()[source]¶ List all kadastrale afdelingen in Flanders.
Parameters: sort (integer) – Field to sort on. Return type: A list
ofAfdeling
.
-
list_kadastrale_afdelingen_by_gemeente
(gemeente, sort=1)[source]¶ List all kadastrale afdelingen in a gemeente.
Parameters: - gemeente – The
Gemeente
for which the afdelingen are wanted. - sort (integer) – Field to sort on.
Return type: - gemeente – The
-
-
class
crabpy.gateway.capakey.
GatewayObject
(**kwargs)[source]¶ Abstract class for all objects being returned from the Gateway.
-
gateway
= None¶ The
crabpy.gateway.capakey.CapakeyGateway
to use when making further calls to the Capakey service.
-
-
class
crabpy.gateway.capakey.
Gemeente
(id, naam=None, centroid=None, bounding_box=None, shape=None, **kwargs)[source]¶ The smallest administrative unit in Belgium.
-
class
crabpy.gateway.capakey.
Perceel
(id, sectie, capakey, percid, adres=None, capatype=None, cashkey=None, centroid=None, bounding_box=None, shape=None, **kwargs)[source]¶ A Cadastral Parcel.
-
class
crabpy.gateway.capakey.
Sectie
(id, afdeling, centroid=None, bounding_box=None, shape=None, **kwargs)[source]¶ A subdivision of a
Afdeling
.
-
crabpy.gateway.capakey.
capakey_rest_gateway_request
(url, headers={}, params={})[source]¶ Utility function that helps making requests to the CAPAKEY REST service.
Parameters: Returns: Result of the call.
-
crabpy.gateway.capakey.
check_lazy_load_afdeling
(f)[source]¶ Decorator function to lazy load a
Afdeling
.
-
crabpy.gateway.capakey.
check_lazy_load_gemeente
(f)[source]¶ Decorator function to lazy load a
Gemeente
.
Gateway exception module¶
This module contains custom errors that can be generated by gateways.
New in version 0.2.0.
-
exception
crabpy.gateway.exception.
GatewayAuthenticationException
(message, soapfault)[source]¶ An exception that signifies something went wrong during authentication.
Wsa module¶
This module contains utiltiy functions for using WSA with SOAP services.
New in version 0.1.0.
Wsse module¶
This module adds a UsernameDigestToken
for use with SOAP services.
New in version 0.2.0.
-
class
crabpy.wsse.
UsernameDigestToken
(username=None, password=None)[source]¶ Represents a basic WS-Security token with password digest