API Documentation

Client module

This module contains utiltiy functions for interacting with AGIV soap services.

New in version 0.1.0.

crabpy.client.capakey_factory(**kwargs)[source]

Factory that generates a CAPAKEY client.

Return type:suds.client.Client
crabpy.client.capakey_request(client, action, *args)[source]

Utility function help making requests to the CAPAKEY service.

Parameters:
  • client – A suds.client.Client for the CAPAKEY service.
  • action (string) – Which method to call, eg. ListAdmGemeenten.
Returns:

Result of the SOAP call.

crabpy.client.crab_factory(**kwargs)[source]

Factory that generates a CRAB client.

Return type:suds.client.Client

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, **kwargs)[source]

A Cadastral Division of a Gemeente.

class crabpy.gateway.capakey.CapakeyGateway(client, **kwargs)[source]

A gateway to the capakey webservice.

get_gemeente_by_id(id)[source]

Retrieve a gemeente by id (the NIScode).

Return type:Gemeente
get_kadastrale_afdeling_by_id(id)[source]

Retrieve a ‘kadastrale afdeling’ by id.

Parameters:id – 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_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:

Perceel

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 of Gemeente.
list_kadastrale_afdelingen(sort=1)[source]

List all kadastrale afdelingen in Flanders.

Parameters:sort (integer) – Field to sort on.
Return type:A list of Afdeling.
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:

A list of Afdeling.

list_percelen_by_sectie(sectie, sort=1)[source]

List all percelen in a sectie.

Parameters:
  • sectie – The Sectie for which the percelen are wanted.
  • sort (integer) – Field to sort on.
Return type:

A list of Perceel.

list_secties_by_afdeling(afdeling)[source]

List all secties in a kadastrale afdeling.

Parameters:afdeling – The Afdeling for which the secties are wanted. Can also be the id of and afdeling.
Return type:A list of Sectie.
class crabpy.gateway.capakey.Gemeente(id, naam=None, centroid=None, bounding_box=None, **kwargs)[source]

The smallest administrative unit in Belgium.

class crabpy.gateway.capakey.Perceel(id, sectie, capakey, percid, capatype=None, cashkey=None, centroid=None, bounding_box=None, **kwargs)[source]

A Cadastral Parcel.

class crabpy.gateway.capakey.Sectie(id, afdeling, centroid=None, bounding_box=None, **kwargs)[source]

A subdivision of a Afdeling.

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.

crabpy.gateway.capakey.check_lazy_load_perceel(f)[source]

Decorator function to lazy load a Perceel.

crabpy.gateway.capakey.check_lazy_load_sectie(f)[source]

Decorator function to lazy load a Sectie.

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.

exception crabpy.gateway.exception.GatewayException(message)[source]

A base exception.

exception crabpy.gateway.exception.GatewayRuntimeException(message, soapfault)[source]

An exception that signifies a soap request went wrong.

soapfault = None

The soapfault that was generated by the service.

Wsa module

This module contains utiltiy functions for using WSA with SOAP services.

New in version 0.1.0.

class crabpy.wsa.Action(action)[source]

Assist in rendering a WSA:Action element.

class crabpy.wsa.MessageID[source]

Assist in rendering a WSA:MessageID element.

class crabpy.wsa.To(location)[source]

Assist in rendering a WSA:To element.

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