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'}]
Metadata
Release files for tesco 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tesco-1.1.0.tar.gz | 4.5 kB | Without provenance | Details for tesco-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tesco-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for tesco-1.1.0-py3-none-any.whl |
Total release size: 8.1 kB
Release files / tesco-1.1.0.tar.gz
| Download URL | tesco-1.1.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10494234e8bd29b2e267b17b1a23c452690f673d2ea688779a6ead97f8cfe845
|
|
BLAKE2b-256 checksum How to use checksums |
8d342fc72f38700fce0adb0b5db693b3816066efe063ced75172ee4f7cf9f307
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.5 CPython/3.8.2 Linux/5.4.0-7626-generic
|
Release files / tesco-1.1.0-py3-none-any.whl
| Download URL | tesco-1.1.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d7d517c8f89007d7954362c99fdf6ec4e50eaa7e8b00fa8576d28874395e445
|
|
BLAKE2b-256 checksum How to use checksums |
6cf463d9d651d101fcc9426fd1e60e70d58fc3a89e2ace8a32ced3f9fa60ca92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.5 CPython/3.8.2 Linux/5.4.0-7626-generic
|
Security for tesco 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.