Skip to main content

No project description provided

Project description

Buy me a coffee

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()

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

python_picnic_api2-1.3.4.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_picnic_api2-1.3.4-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file python_picnic_api2-1.3.4.tar.gz.

File metadata

  • Download URL: python_picnic_api2-1.3.4.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_picnic_api2-1.3.4.tar.gz
Algorithm Hash digest
SHA256 9d1772ad1c84b4040f70b75775e85e1bb8586ca473b0662b92db232e70aa1f4b
MD5 168d72b11d1fa5d88d92a7e489adfaac
BLAKE2b-256 e64dd6466478d0c995f25ff3a2c26b14591bc41903697905b55967ba05faccb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_picnic_api2-1.3.4.tar.gz:

Publisher: release.yml on codesalatdev/python-picnic-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_picnic_api2-1.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for python_picnic_api2-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2a725685ec7536e3a6f35ebe0874237a35c06240971873272624cfa61c9e27b2
MD5 900fd1540e946f2ab5baf31c5a9a7f9e
BLAKE2b-256 468d10983e36f6d6953c7620d1d8aa004d608ce967424d3d7f87a1be4c208652

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_picnic_api2-1.3.4-py3-none-any.whl:

Publisher: release.yml on codesalatdev/python-picnic-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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