Skip to content

Add Czech and Slovak IČO validation#504

Open
DMZ22 wants to merge 1 commit into
arthurdejong:masterfrom
DMZ22:add-cz-sk-ico
Open

Add Czech and Slovak IČO validation#504
DMZ22 wants to merge 1 commit into
arthurdejong:masterfrom
DMZ22:add-cz-sk-ico

Conversation

@DMZ22

@DMZ22 DMZ22 commented Jul 23, 2026

Copy link
Copy Markdown

This implements #450: validation for the IČO, the organisation identifier used in the Czech Republic and Slovakia.

Format

  • Name: IČO — Identifikační číslo osoby (CZ) / Identifikačné číslo organizácie (SK), also written IČ.
  • Structure: 8 digits, the last being a weighted modulo-11 check digit (weights 8…2 over the first 7 digits, check digit (11 - sum) % 11, mapped so a remainder of 0 → 1).
  • Identifies a legal entity or sole trader; listed in the Czech ARES register and the Slovak ORSR / RPO registers.

Relation to DIČ (raised in the issue)

For a legal entity the IČO is exactly the digits of the Czech VAT number (DIČ) without the CZ prefix, so cz/ico uses the same check-digit computation that cz/dic already applies to its 8-digit legal-entity form. The Slovak IČO is identical to the Czech one (until 1993 they were a single country), so sk/ico delegates to cz/ico, mirroring the existing sk/rccz/rc pattern.

Sources

Tests

  • Module docstrings cover valid input, invalid check digit, wrong length and non-digit input.
  • tests/test_cz_ico.doctest and tests/test_sk_ico.doctest each bulk-validate 21 real numbers taken from public company records (e.g. Škoda Auto 00177041, ČEZ 45274649; Slovnaft 31322832, Tatra banka 00686930).
  • All doctests pass under NORMALIZE_WHITESPACE/IGNORE_EXCEPTION_DETAIL; every line of the new modules is exercised (100% coverage).

Happy to add a format() grouping or an IČO → DIČ helper if you'd find either useful.

The IČO (Identifikační číslo osoby / Identifikačné číslo organizácie) is
the 8-digit number that identifies a legal entity or sole trader in the
Czech Republic and Slovakia, registered in the ARES and ORSR/RPO business
registers. It carries a trailing weighted-modulo-11 check digit.

For a legal entity the digits are the same as the Czech VAT number (DIČ)
without the CZ prefix, so cz/ico reuses the check-digit algorithm already
present in cz/dic for the 8-digit legal-entity form. The Slovak number is
identical to the Czech one (until 1993 they were one country), so sk/ico
delegates to cz/ico following the existing sk/rc -> cz/rc pattern.

Detailed doctests validate 21 real Czech and 21 real Slovak numbers.

Implements arthurdejong#450.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant