# stdnum.li.peid

PEID (Liechtenstein tax code for individuals and entities).

The Personenidentifikationsnummer (PEID) is an numeric code up to 12 digits used to identify entities and individuals residing in Liechtenstein.

More information:

- https://www.oera.li/

- https://www.oecd.org/tax/automatic-exchange/crs-implementation-and-assistance/tax-identification-numbers/LIECHTENSTEIN%20TIN.pdf

    >>> compact('00001234567')
    '1234567'
    >>> validate('1234567')  # personal number or entity number
    '1234567'
    >>> validate('00001234567')
    '1234567'
    >>> validate('00001234568913454545')
    Traceback (most recent call last):
        ...
    InvalidLength: The number has an invalid length.

stdnum.li.peid.compact(number: str) → str

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

stdnum.li.peid.is_valid(number: str) → bool

  Check if the given fiscal code is valid.

stdnum.li.peid.validate(number: str) → str

  Check if the given fiscal code is valid.