Skip to main content

Initial Release

Project description

datakick is a python wrapper for the Datakick open product database API.



python install


pip install datakick

Sample Code:

First import the module:

>>> import datakick

Search for products by barcode:

>>> gtin14 = "037000062219"
>>> product = datakick.find_product(gtin14)
>>> print("{} - {}".format(product.brand_name,
'Crest Pro-Health Clean Mint Toothpaste'

Search for products with a key:

>>> products ="Toothpaste")
>>> for product in products:
...    print("{} - {}".format(product.brand_name,
'Crest Pro-Health Clean Mint Toothpaste'
'Sensodyne Fresh Impact Toothpaste'
# etc.

Add/modify products in the database:

>>> gtin14 = "011110491503"
>>> product = datakick.add_product(
... gtin14, brand_name="Big K", name="Diet Cola", size="355mL"
... )

>>> print("{} - {} - {}".format(
... product.brand_name,, product.size)
... )
'Big K Diet Cola 355mL'

Add images to products in the database:

>>> gtin14 = "011110491503"
>>> img_path = "path/to/your/image/cola.jpg"  # only .jpg or .jpeg allowed!
>>> img_url = datakick.add_image(gtin14, img_path)

>>> print(img_url)

List the products (on a page):

>>> products = datakick.list_products(5)  # each page returns 100 products

>>> for product in products:
...     print(product.gtin14)
# etc.

Optional Parameters for Adding/Modifying a product:

Optional Parameters Type Units Example
name string n/a “Toothpaste”
brand_name string n/a “Colgate”
size string n/a “20oz”
ingredients string n/a “Milk, Chocolate, Sugar”
serving_size string n/a “2 tbsp.”
servings_per_container string n/a “2 cookies”
calories int n/a 200
fat_calories int n/a 100
fat int/float grams 10
saturated_fat int/float grams 10
trans_fat int/float grams 0
polyunsaturated_fat int/float grams 5
monounsaturated_fat int/float grams 5
cholesterol int milligrams 20
sodium int milligrams 40
potassium int milligrams 60
carbohydrate int grams 20
fiber int grams 10
sugars int grams 6
protein int grams 4
author string n/a “First M. Last”
publisher string n/a “MyPublisher”
pages int n/a 400
alcohol_by_volume int/float percent 20


  • datakick.exceptions.ImageTooLarge - Will be thrown if the image provided to datakick.add_image is too large (>1MB)
  • datakick.exceptions.InvalidImageFormat - Will be thrown if the image provided to datakick.add_image is of the wrong file format (only .jpg or .jpeg allowed).
  • requests.exceptions.HTTPError - Will be thrown if the gtin14 provided is invalid or not found in the product database.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for datakick, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size datakick-0.0.1.tar.gz (6.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page