MikeBrink / python-picnic-api

Unofficial Python wrapper for the Picnic API.
Apache License 2.0
53 stars 16 forks source link

Calculate total quantity ordered from list of deliveries #2

Closed wjwillemse closed 3 years ago

wjwillemse commented 3 years ago

Great package Mike! I was wondering whether it would be possible to calculate the total quantity ordered during a certain period or from a list of deliveries, and also the average daily quantity consumed. Then we could predict when an item should be ordered.

MikeBrink commented 3 years ago

Hi,

Sorry for the late response, but glad to hear you are enjoying the repo!

You are already able to achieve this with the current version! I'll give an example below:

from python_picnic_api import PicnicAPI

picnic = PicnicAPI(username='username', password='password')
picnic.get_deliveries()

This will return a list in which every element is a dict for every delivery.