Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 457 Bytes

postalcode.rst

File metadata and controls

20 lines (12 loc) · 457 Bytes

Postal Code Validation Functions

The following functions are used to validate postal codes.

from sanatio import Sanatio

val = Sanatio()
isPostalCode(value, locale) - return true if the postal code is valid for the country

args: value, locale

>>> val.isPostalCode(value='110016', locale='IN')
True
>>> val.isPostalCode(value='10133-1234', locale='US')
True