# stdnum.si.emso

Enotna matična številka občana (Unique Master Citizen Number).

The EMŠO is used for uniquely identify persons including foreign citizens living in Slovenia, It is issued by Centralni Register Prebivalstva CRP (Central Citizen Registry).

The number consists of 13 digits and includes the person’s date of birth, a political region of birth and a unique number that encodes a person’s gender followed by a check digit.

More information:

- https://en.wikipedia.org/wiki/Unique_Master_Citizen_Number

- https://sl.wikipedia.org/wiki/Enotna_matična_številka_občana

    >>> validate('0101006500006')
    '0101006500006'
    >>> validate('0101006500007')  # invalid check digit
    Traceback (most recent call last):
        ...
    InvalidChecksum: ...

stdnum.si.emso.calc_check_digit(number: str) → str

  Calculate the check digit.

stdnum.si.emso.compact(number: str) → str

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

stdnum.si.emso.format(number: str) → str

  Reformat the number to the standard presentation format.

stdnum.si.emso.get_birth_date(number: str) → date

  Return date of birth from valid EMŠO.

stdnum.si.emso.get_gender(number: str) → str

  Get the person’s birth gender (‘M’ or ‘F’).

stdnum.si.emso.get_region(number: str) → str

  Return (political) region from valid EMŠO.

stdnum.si.emso.is_valid(number: str) → bool

  Check if the number provided is a valid ID. This checks the length, formatting and check digit.

stdnum.si.emso.validate(number: str) → str

  Check if the number is a valid EMŠO number. This checks the length, formatting and check digit.