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

You can install the eansearch module directly with pip:

python -m pip install eansearch

Then use EANSearch in your own scripts like this:

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"], "(Google ID", product["googleCategoryId"], ") 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")

# search for product name "iPod", get the first page of the results, only English results
eanList = eansearch.productSearch("iPod")
for product in eanList:
	print(product["ean"], " is ", product["name"].encode("utf-8"))

# search for similar product names, get the first page of the results, in any language
eanList = eansearch.similarProductSearch("iPod with extra features", 0, 99)
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", 300, 200)
print("HTML: <img src=\"data:image/png;base64," + " encoded + "\">")

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eansearch-1.11.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eansearch-1.11.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eansearch-1.11.0.tar.gz
Algorithm Hash digest
SHA256 b11f1310ffb13fd3e3745a5c1b06094dd966590657f64b8d8dd010488592f5b5
MD5 0cda5d7ba0db57965fe039c84038e950
BLAKE2b-256 2cd01250035fbbe318891707a6b71c1555d1aa2728c8ae0dae48ba49012c4f2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for eansearch-1.11.0.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.11.0-py3-none-any.whl.

File metadata

  • Download URL: eansearch-1.11.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eansearch-1.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7dc84f8aae9259dd9117bc8b872984840c98f84e4f2e136228c1fa893dd035b
MD5 3b27bd663ca351c66e99b732641b0503
BLAKE2b-256 68b7146ff77402daf211a0aea02034ac17379f6adb03e03df1df18e8cb9e54c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for eansearch-1.11.0-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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page