checkdigit.gs1.validate¶
- checkdigit.gs1.validate(data: str) bool [source]¶
Validates GS1.
This method works for all fixed length numeric GS1 data structures (including GDTI, GLN, GRAI, etc.) that require a check digit.
- Parameters:
data – A string of characters representing a full GS1 code
- Returns:
- A boolean representing whether the
check digit validates the data or not
- Return type:
bool
Examples
>>> from checkdigit import gs1 >>> gs1.validate("224245438987081447") False >>> gs1.validate("961552634342856982") True