Unofficial python package to access Bring! shopping lists API.
Project description
Bring Shopping Lists API
An unofficial python package to access the Bring! shopping lists API.
This is a minimal python port of the node-bring-api by foxriver76. All credit goes to him for making this awesome API possible!
Disclaimer
The developers of this module are in no way endorsed by or affiliated with Bring! Labs AG, or any associated subsidiaries, logos or trademarks.
Installation
pip install python-bring-api
Usage Example
import logging
import sys
from python_bring_api.bring import Bring
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
# Create Bring instance with email and password
bring = Bring("EMAIL", "PASSWORD")
# Login
bring.login()
# Get information about all available shopping lists
lists = bring.loadLists()["lists"]
# Save an item with specifications to a certain shopping list
bring.saveItem(lists[0]['listUuid'], 'Milk', 'low fat')
# Get all the items of a list
items = bring.getItems(lists[0]['listUuid'])
print(items['purchase']) # [{'specification': 'low fat', 'name': 'Milk'}]
# Remove an item from a list
bring.removeItem(lists[0]['listUuid'], 'Milk')
Exceptions
In case something goes wrong during a request, several exceptions can be thrown. They will either be BringRequestException, BringParseException, or BringAuthException, depending on the context. All inherit from BringException.
Changelog
2.0.0
Add exceptions and typings, thanks to @miaucl!
Important: Unsuccessful HTTP status codes will now raise an exception.
Module now requires Python version >= 3.8.
1.2.2
Clean up unused code 🧹
1.2.1
Fix encoding in login request, thanks to @tony059!
1.2.0
Add function to update an item, thanks to @Dielee!
1.1.2
Add option to provide own headers, thanks to @Dielee!
1.1.0
Add item details endpoint, thanks to @Dielee!
1.0.2
Fixed error handling Added response return to login
1.0.1
Add github repo
1.0.0
Initial release
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
Built Distribution
File details
Details for the file python-bring-api-2.0.0.tar.gz
.
File metadata
- Download URL: python-bring-api-2.0.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94482c4f779a8b39b7172421ec4dfa576f243b7ecbfe758371faea7bb3373711 |
|
MD5 | 8b0e31e348a9910fe73f354559a01341 |
|
BLAKE2b-256 | 3f498a1fd1b2d24e597d9224a07302b50d5e564090df2eae0c140f8ff01aff66 |
File details
Details for the file python_bring_api-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: python_bring_api-2.0.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 887b1fe1b6b4e97071c532e86092674e31e420519947ae796299ad0723468570 |
|
MD5 | 9128269333125377e38cc4dbcff6aca1 |
|
BLAKE2b-256 | eb85dfb5b4a05c2c4aa9a8ec59e3f34f40d2ce5663de0e96fdee1acb3f718423 |