stdnum.at.postleitzahl¶
Postleitzahl (Austrian postal code).
The Austrian postal code consists of four digits that identifies a post office in Austria.
More information:
>>> validate('5090')
'5090'
>>> import json
>>> print(json.dumps(info('5090'), indent=2, sort_keys=True))
{
"location": "Lofer",
"region": "Salzburg"
}
>>> validate('4231') # not-existing postal code
Traceback (most recent call last):
...
InvalidComponent: ...
>>> validate('ABCD')
Traceback (most recent call last):
...
InvalidFormat: ...
- stdnum.at.postleitzahl.compact(number)¶
Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
- stdnum.at.postleitzahl.info(number)¶
Return a dictionary of data about the supplied number. This typically returns the location.
- stdnum.at.postleitzahl.is_valid(number)¶
Check if the number is a valid postal code.
- stdnum.at.postleitzahl.validate(number)¶
Check if the number is a valid postal code.