A Python class for EAN and ISBN name lookup and validation using the API on ean-search.org
Project description
EANSearch
A Python class for EAN and ISBN name lookup and validation using the API on https://www.ean-search.org
Compatible with Python 2.x and 3.x
from eansearch import EANSearch
# get a token from https://www.ean-search.org/ean-database-api.html
apiToken = "secret"
ean = "5099750442227" # Thriller
eansearch = EANSearch(apiToken)
name = eansearch.barcodeLookup(ean)
print(ean, " is ", name)
# more detailed result, preferrably in English (1)
product = eansearch.barcodeSearch(ean, 1)
print(ean, " is ", product["name"].encode("utf-8"), " from category ", product["categoryName"], " issued in ", product["issuingCountry"])
ok = eansearch.verifyChecksum(ean)
print(ean, " is ", "OK" if ok else "Not OK")
eanList = eansearch.productSearch('iPod');
for product in eanList:
print(product["ean"], " is ", product["name"].encode("utf-8"))
eanList = eansearch.categorySearch(45, 'thriller');
for product in eanList:
print(product["ean"], " is ", product["name"].encode("utf-8"))
eanList = eansearch.barcodePrefixSearch('4007249146');
for product in eanList:
print(product["ean"], " is ", product["name"].encode("utf-8"))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
eansearch-1.4.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for eansearch-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2a59457a2f84b0bd9ca255a53e0947dcc7054ca532db44b9630dd4c13fb7f37 |
|
MD5 | cc5141f33a7ff2c185309b54e2b882bf |
|
BLAKE2b-256 | 79933b16d72823e52db22dbb01f63c60a787ec75ab1dec229ea36ab48977e249 |