Skip to main content

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"])

isbn = "1119578884"
title = eansearch.isbnLookup(isbn)
print(isbn, " is ", title)

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.similarProductSearch('iPod with extra features')
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"))

country = eansearch.issuingCountryLookup("5099750442227")
print(ean + " was issued in " + country)

barcode = eansearch.barcodeImage("5099750442227")
print("Barcode image for " + ean + " (base64 encoded): " + barcode)

#import base64
#print (base64.b64decode(barcode))

Project details


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.8.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

eansearch-1.8.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file eansearch-1.8.3.tar.gz.

File metadata

  • Download URL: eansearch-1.8.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for eansearch-1.8.3.tar.gz
Algorithm Hash digest
SHA256 4240556d4e1071f3f6d0e9bc07a8312ed13a05b3ddd532d28cafc16d0a67b63a
MD5 ecdd319459fefdd4874dd978c7164bfd
BLAKE2b-256 8e289d0f39e1f6d721a5c1e4ada003c897777e57d9270508a9c2c5f4669bdef1

See more details on using hashes here.

Provenance

The following attestation bundles were made for eansearch-1.8.3.tar.gz:

Publisher: release.yml on eansearch/python-ean-search

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eansearch-1.8.3-py3-none-any.whl.

File metadata

  • Download URL: eansearch-1.8.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for eansearch-1.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cac2b5b77a55692033468be548e3585b1afc5a899f1fd07be93154c4bf660ee1
MD5 4abaebf18debe29636c529bdd7b60f09
BLAKE2b-256 e5d424f3459196ffc09e7f32245cff7971848be79c4a3db5f800578294946f50

See more details on using hashes here.

Provenance

The following attestation bundles were made for eansearch-1.8.3-py3-none-any.whl:

Publisher: release.yml on eansearch/python-ean-search

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page