Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charithe/gtin-validator
Validates GTIN codes
https://github.com/charithe/gtin-validator
Last synced: 3 months ago
JSON representation
Validates GTIN codes
- Host: GitHub
- URL: https://github.com/charithe/gtin-validator
- Owner: charithe
- Created: 2011-10-13T22:56:39.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2018-07-30T23:43:11.000Z (over 6 years ago)
- Last Synced: 2024-07-16T15:47:00.497Z (4 months ago)
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 35
- Watchers: 4
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- starred-awesome - gtin-validator - Validates GTIN codes (Python)
README
GTIN Validator
==============[![Build Status](https://travis-ci.org/charithe/gtin-validator.svg?branch=master)](https://travis-ci.org/charithe/gtin-validator)
Validates GTIN (Global Trade Item Number) codes by calculating checksums. Supports both Python 2 and 3.
GTIN comprises of GTIN-8, GTIN-12, GTIN-13 and GTIN-14 codes. EAN, UPC and ISBN can be thought of as subsets of GTIN. For more information, see: http://www.gs1.org/barcodes/technical/idkeys/gtin and http://en.wikipedia.org/wiki/Global_Trade_Item_Number
Usage
-----Install from PyPi
```
pip install gtin-validator
```The module exports a single function `is_valid_GTIN` - which accepts either string or integer arguments. Dashes in the code (commonly found in ISBN numbers) are supported.
```python
from gtin.validator import *if __name__ == '__main__':
print is_valid_GTIN("9780552133265")
print is_valid_GTIN("978-0-552-13326-5")
print is_valid_GTIN(9780552133265)
```