# 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)

  Calculate the check digit.

stdnum.si.emso.compact(number)

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

stdnum.si.emso.format(number)

  Reformat the number to the standard presentation format.

stdnum.si.emso.get_birth_date(number)

  Return date of birth from valid EMŠO.

stdnum.si.emso.get_gender(number)

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

stdnum.si.emso.get_region(number)

  Return (political) region from valid EMŠO.

stdnum.si.emso.is_valid(number)

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

stdnum.si.emso.validate(number)

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