Python-Picnic-API
Unofficial Python wrapper for the Picnic API. While not all API methods have been implemented yet, you’ll find most of what you need to build a working application are available.
This library is not affiliated with Picnic and retrieves data from the endpoints of the mobile application. Use at your own risk.
Getting started
The easiest way to install is directly from pip:
$ pip install python-picnic-api
Usage
I’ll go over a few common operations here you’ll most likely use in applications. To login:
from python_picnic_api import PicnicAPI
picnic = PicnicAPI(username='username', password='password', country_code="NL")
The country_code parameter defaults to NL, but you have to change it if you live in a different country than the Netherlands (Germany: DE, Belgium: BE). You can also store your credentials by setting the store value to true, this will store your credentials and country_code in /config/app.yaml.
Searching for a product
>>> picnic.search('coffee')
[{'type': 'CATEGORY', 'id': 'coffee', 'links': [{'type': 'SEARCH', 'href': 'https://storefront-prod.nl.picnicinternational.com/api/15/search?search_term=coffee'}], 'name': 'coffee', 'items': [{'type': 'SINGLE_ARTICLE', 'id': '10511523', 'decorators': [{'type': 'UNIT_QUANTITY', 'unit_quantity_text': '500 gram'}], 'name': 'Lavazza espresso koffiebonen', 'display_price': 599, 'price': 599, 'image_id': 'd3fb2888fc41514bc06dfd6b52f8622cc222d017d2651501f227a537915fcc4f', 'max_count': 50, 'unit_quantity': '500 gram', 'unit_quantity_sub': '€11.98/kg', 'tags': []}, ...
Check cart
>>> picnic.get_cart()
{'type': 'ORDER', 'id': 'shopping_cart', 'items': [], 'delivery_slots': [...
Manipulating your cart
All of these methods will return the shopping cart.
# adding 2 'Lavazza espresso koffiebonen' to cart
picnic.add_product('10511523', count=2)
# removing 1 'Lavazza espresso koffiebonen' from cart
picnic.remove_product('10511523')
# clearing the cart
picnic.clear_cart()
See upcoming deliveries
>>> picnic.get_current_deliveries()
[]
See available delivery slots
>>> picnic.get_delivery_slots()
Metadata
Release files for python-picnic-api 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 | |
|---|---|---|---|
| python-picnic-api-1.1.0.tar.gz | 9.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_picnic_api-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.0 kB
Release files / python-picnic-api-1.1.0.tar.gz
| Download URL | python-picnic-api-1.1.0.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9771926d6f613c4d1822de6f56ca3eafc4b18bc80796c154ab49f1a117e1b8ab
|
|
BLAKE2b-256 checksum How to use checksums |
2c94490e8dd9817ed831de0686f6db8fb2010afbc9f5f833bbc8da3ff0347495
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.5 Linux/5.8.0-48-generic
|
Release files / python_picnic_api-1.1.0-py3-none-any.whl
| Download URL | python_picnic_api-1.1.0-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e526d08f708f049c7ca1ce6744ecd04c9f8dfe95535457a8410efb8e189d2285
|
|
BLAKE2b-256 checksum How to use checksums |
f926c5d2ab89209e2bfc2ab1bca837c009b441ec4be5ddffb7cf6fa9f2438c98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.5 Linux/5.8.0-48-generic
|