# stdnum.gh.tin

TIN (Taxpayer Identification Number, Ghana tax number).

This number is issued by the Ghana Revenue Authority (GRA) to individuals who are not eligible for the Ghanacard PIN and other entities.

This number consists of 11 alphanumeric characters. It begins with one of the following prefixes:

> P00 For Individuals. C00 For Companies limited by guarantee, shares, Unlimited (i.e organisation required to register with the RGD). G00 Government Agencies, MDAs. Q00 Foreign Missions, Employees of foreign missions. V00 Public Institutions, Trusts, Co-operatives, Foreign Shareholder (Offshore), (Entities not registered by RGD).

More information:

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

- https://gra.gov.gh/tin/

- https://gra.gov.gh/tin/tin-faq/

    >>> validate('C0000803561')
    'C0000803561'
    >>> validate('C0000803562')
    Traceback (most recent call last):
        ...
    InvalidChecksum: ...

stdnum.gh.tin.calc_check_digit(number: str) → str

  Calculate the check digit for the TIN.

stdnum.gh.tin.compact(number: str) → str

  Convert the number to the minimal representation.

  This strips the number of any valid separators and removes surrounding whitespace.

stdnum.gh.tin.is_valid(number: str) → bool

  Check if the number is a valid Ghana TIN.

stdnum.gh.tin.validate(number: str) → str

  Check if the number is a valid Ghana TIN.