Skip to main content

Python client for EAN-DB API

Project description

EAN-DB Python client

This is a Python client for EAN-DB API.

EAN-DB is an online API for product info lookups by EAN / UPC / ISBN. Product info includes titles in various languages, categories, manufacturer, images and additional metadata.

For more information, please see API docs and Database stats.

Installation

pip install eandb

Usage

Asynchronous client

>>> from eandb.clients.v2 import EandbV2AsyncClient

>>> eandb_client = EandbV2AsyncClient(jwt='YOUR_JWT_GOES_HERE')
>>> response = await eandb_client.get_product('0016065024615')

Synchronous client

>>> from eandb.clients.v2 import EandbV2SyncClient

>>> eandb_client = EandbV2SyncClient(jwt='YOUR_JWT_GOES_HERE')
>>> response = eandb_client.get_product('0016065024615')
>>> response

ProductResponse(
    balance=100, error=None, 
    product=Product(
        barcode='0016065024615', 
        titles={'en': 'Pretty Tied Up'}, 
        categories=[
            Category(id='855', titles={'en': 'Music & Sound Recordings', ...})
        ],
        manufacturer=Manufacturer(id=None, titles={'de': 'Geffen'}, wikidataId=None),
        relatedBrands=[],
        images=[Image(url='...')], 
        metadata=Metadata(
            externalIds=None,
            generic=Generic(
                weight=None,
                manufacturerCode=None,
                color=None,
                ingredients=None,
                contributors=[Contributor(names={'en': "Guns N' Roses"}, type='artist')]
            ),
            food=None,
            printBook=None,
            musicCD=None
        )
    )
)

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

eandb-0.3.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

eandb-0.3.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

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