No project description provided
Project description
Tesco
A Python wrapper for the Tesco API
Installation
pip install tesco
Usage
from tesco import Tesco
from pprint import pprint
t = Tesco("API KEY")
results = t.grocery_search("cake", offset=0, limit=100)
info = t.product_data(tpnc=results[0]["id"])
pprint(info)
[{'allergenAdvice': {'allergenText': 'May contain milk and peanuts and '
'nuts.For allergens, including cereals '
'containing gluten, see ingredients in '
'bold. \n',
'allergens': [{'allergenName': 'Contains',
'allergenValues': ['May contain milk',
'peanuts',
'nuts.']}]},
'brand': 'TESCO',
'calcNutrition': {'calcNutrients': [{'name': 'Energy (kJ)',
'valuePer100': '1624',
'valuePerServing': '556'},
{'name': 'Energy (kcal)',
'valuePer100': '387',
'valuePerServing': '132'},
{'name': 'Fat (g)',
'valuePer100': '14.8',
'valuePerServing': '5.1'},
{'name': 'Saturates (g)',
'valuePer100': '4.8',
'valuePerServing': '1.6'},
{'name': 'Carbohydrate (g)',
'valuePer100': '57.8',
'valuePerServing': '19.8'},
{'name': 'Sugars (g)',
'valuePer100': '34.6',
'valuePerServing': '11.9'},
{'name': 'Fibre (g)',
'valuePer100': '1.1',
'valuePerServing': '0.4'},
{'name': 'Protein (g)',
'valuePer100': '5',
'valuePerServing': '1.7'},
{'name': 'Salt (g)',
'valuePer100': '0.6',
'valuePerServing': '0.2'}],
'per100Header': 'Per 100g / Per 100ml',
'perServingHeader': 'A serving contains'},
'description': 'Tesco Angel Layer Cake Each',
'gda': {'gdaRefs': [{'footers': ['of the reference intake*',
'Typical values per 100g: Energy 1624kJ / '
'387kcal'],
'gdaDescription': 'Guideline Amounts Per Serv',
'headers': ['1/8 of a cake (34g)'],
'values': [{'name': 'Energy',
'percent': '7',
'values': ['556kJ', '132kcal']},
{'name': 'Fat',
'percent': '7',
'rating': 'medium',
'values': ['5.1g']},
{'name': 'Saturates',
'percent': '8',
'rating': 'medium',
'values': ['1.6g']},
{'name': 'Sugars',
'percent': '13',
'rating': 'high',
'values': ['11.9g']},
{'name': 'Salt',
'percent': '3',
'rating': 'medium',
'values': ['0.2g']}]}]},
'gtin': '05000119153739',
'ingredients': ['<p><strong>INGREDIENTS LIST:</strong><br><br>Sugar',
'Wheat Flour (<strong>Wheat</strong> Flour, Calcium '
'Carbonate, Iron, Niacin, Thiamin), Pasteurised '
'<strong>Egg</strong> White, Vanilla Flavour Filling (11%), '
'Palm Oil, Rapeseed Oil, Humectant (Glycerine), Raising '
'Agents (Disodium Diphosphate, Sodium Bicarbonate), '
'Emulsifier (Mono- and Di-Glycerides of Fatty Acids), '
'Preservative (Potassium Sorbate), Salt, Colours (Carmines, '
'Carotenes).<br><br>Vanilla Flavour Filling contains: Sugar, '
'Palm Oil, Rapeseed Oil, Glucose Syrup, Rice Starch, '
'Emulsifier (Mono- and Di-Glycerides of Fatty Acids), '
'Flavouring, Acidity Regulator (Citric Acid), Colour (Plain '
'Caramel).</p>'],
'marketingText': 'Teatime classic Layered sponge with vanilla flavour '
'filling for a light, delicate cake\n'
'Teatime classic Layered sponge with vanilla flavour '
'filling for a light, delicate cake',
'pkgDimensions': [{'depth': 5.2,
'dimensionUom': 'cm',
'height': 7.0,
'no': 1,
'volume': 666.12,
'volumeUom': 'cc',
'weight': 278.0,
'weightUom': 'g',
'width': 18.3}],
'productAttributes': [],
'productCharacteristics': {'containsLoperamide': False,
'healthScore': 38,
'isAnalgesic': False,
'isDrink': False,
'isFood': True,
'isHazardous': False,
'storageType': 'Ambient'},
'qtyContents': {'netContents': '1',
'numberOfUnits': '1',
'quantity': 1.0,
'quantityUom': 'SNGL',
'unitQty': 'EACH'},
'storage': ['Not suitable for home freezing. \n'
'Store in a cool, dry place and once opened in an airtight '
'container.\n'
' '],
'tpnb': '050556274',
'tpnc': '254946995'}]
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
tesco-1.1.0.tar.gz
(4.5 kB
view details)
Built Distribution
tesco-1.1.0-py3-none-any.whl
(3.7 kB
view details)
File details
Details for the file tesco-1.1.0.tar.gz
.
File metadata
- Download URL: tesco-1.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.4.0-7626-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10494234e8bd29b2e267b17b1a23c452690f673d2ea688779a6ead97f8cfe845 |
|
MD5 | abc378a5611ec1d1b42396c49259eb97 |
|
BLAKE2b-256 | 8d342fc72f38700fce0adb0b5db693b3816066efe063ced75172ee4f7cf9f307 |
File details
Details for the file tesco-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: tesco-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.4.0-7626-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d7d517c8f89007d7954362c99fdf6ec4e50eaa7e8b00fa8576d28874395e445 |
|
MD5 | 34a3464b037352dfe449d004ac6c8a98 |
|
BLAKE2b-256 | 6cf463d9d651d101fcc9426fd1e60e70d58fc3a89e2ace8a32ced3f9fa60ca92 |