stdnum.nl.postcode

Postcode (Dutch postal code).

The Dutch postal code consists of four numbers followed by two letters.

>>> validate('2601 DC')
'2601 DC'
>>> validate('NL-2611ET')
'2611 ET'
>>> validate('26112 ET')
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> validate('2611 SS')  # a few letter combinations are banned
Traceback (most recent call last):
    ...
InvalidComponent: ...
Traceback (most recent call last):
    ...
InvalidComponent: ...
stdnum.nl.postcode.compact(number)

Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.

stdnum.nl.postcode.is_valid(number)

Checks to see if the number provided is a valid postal code.

stdnum.nl.postcode.validate(number)

Checks to see if the number provided is in the correct format. This currently does not check whether the code corresponds to a real address.

Previous topic

stdnum.nl.onderwijsnummer

Next topic

stdnum.no.mva