Unofficial package to access Cookidoo.
Project description
Cookidoo API
An unofficial python package to access Cookidoo.
Disclaimer
The developers of this module are in no way endorsed by or affiliated with Cookidoo or Vorwerk, or any associated subsidiaries, logos or trademarks.
Installation
pip install cookidoo-api
Documentation
See below for usage examples.
Usage Example
The API is based on the aiohttp library.
Make sure to have stored your credentials in the top-level file .env as such, to loaded by dotenv. Alternatively, provide the environment variables by any other dotenv compatible means.
EMAIL=your@mail.com
PASSWORD=password
Run the example script and have a look at the inline comments for more explanation.
Exceptions
In case something goes wrong during a request, several exceptions can be thrown, all inheriting from CookidooException.
Another asyncio event loop is
With the async calls, you might encounter an error that another asyncio event loop is already running on the same thread. This is expected behavior according to the asyncio.run() documentation. You cannot use more than one aiohttp session per thread, reuse the existing one!
Exception ignored: RuntimeError: Event loop is closed
Due to a known issue in some versions of aiohttp when using Windows, you might encounter a similar error to this:
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000000>
Traceback (most recent call last):
File "C:\...\py38\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\...\py38\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\...\py38\lib\asyncio\base_events.py", line 719, in call_soon
self._check_closed()
File "C:\...\py38\lib\asyncio\base_events.py", line 508, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
You can fix this according to this StackOverflow answer by adding the following line of code before executing the library:
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
Dev
Setup the dev environment using VSCode, it is highly recommended.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements_dev.txt
Install pre-commit
pre-commit install
# Run the commit hooks manually
pre-commit run --all-files
Following VSCode integrations may be helpful:
Raw API Requests
The raw requests intercepted between the Cookidoo Android App and the backend can be found here ./docs/raw-api-requests. They have been used to reconstruct the API which is implemented in this library.
Testing
There is a set of tests based on the current behaviour of the API.
Unit tests
The unit tests base on the recorded payloads captured between the server and the android app. They are a snapshot and might change.
Smoke tests
The smoke tests implements a series of request querying the server. It tries to cover as much functionality as possible while not impacting the server too much (we want to stay nice and not get noticed ^^). Therefore, it still might be the case that something breaks without noticing. Further, as it is a github action, only non-premium are tested, as it is currently not deemed worth keeping premium subscription for this sole purpose (might change my mind with a few donations^^). Should something break for premium features, a temporary account with trial period is created easily.
Releasing
A final version can only be released from the master branch. To pass the gates of the publish workflow, the version must match in both the tag and cookidoo_api/__init__.py.
To release a prerelease version, it must be done from a feature branch (not master). Prerelease versions are explicitly marked as such on the GitHub release page.
Roadmap
- Add custom recipes to calendar and shopping list
- Edit custom recipes
- Create blank custom recipes (not copy existing)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cookidoo_api-0.15.0.tar.gz.
File metadata
- Download URL: cookidoo_api-0.15.0.tar.gz
- Upload date:
- Size: 31.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b7ef79ccc8183117670280d30bab090ebccf35e0c37b6fb8eddfb4daa99f0db
|
|
| MD5 |
5b52671d101211822648f5307d1b7ce9
|
|
| BLAKE2b-256 |
e020d13d8ab494d5834d1bacde54edeceaabdba394956d8acf2dff2083581306
|
Provenance
The following attestation bundles were made for cookidoo_api-0.15.0.tar.gz:
Publisher:
publish-to-pypi.yml on miaucl/cookidoo-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cookidoo_api-0.15.0.tar.gz -
Subject digest:
0b7ef79ccc8183117670280d30bab090ebccf35e0c37b6fb8eddfb4daa99f0db - Sigstore transparency entry: 604584697
- Sigstore integration time:
-
Permalink:
miaucl/cookidoo-api@36ce9fce38219a770fc1361cc1ebc59877ffeb09 -
Branch / Tag:
refs/tags/0.15.0 - Owner: https://github.com/miaucl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@36ce9fce38219a770fc1361cc1ebc59877ffeb09 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cookidoo_api-0.15.0-py3-none-any.whl.
File metadata
- Download URL: cookidoo_api-0.15.0-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0db00749b12dc9d217bb5cc0653eb121a830d646d2751f8a85cb9a084b854d8
|
|
| MD5 |
fbebb41dbe5a2492ef460389e3a38276
|
|
| BLAKE2b-256 |
52402272ca45cf2918bdc4565df0671a9bc3f7af340f7d205ae1f6ae1efc1cc5
|
Provenance
The following attestation bundles were made for cookidoo_api-0.15.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on miaucl/cookidoo-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cookidoo_api-0.15.0-py3-none-any.whl -
Subject digest:
a0db00749b12dc9d217bb5cc0653eb121a830d646d2751f8a85cb9a084b854d8 - Sigstore transparency entry: 604584698
- Sigstore integration time:
-
Permalink:
miaucl/cookidoo-api@36ce9fce38219a770fc1361cc1ebc59877ffeb09 -
Branch / Tag:
refs/tags/0.15.0 - Owner: https://github.com/miaucl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@36ce9fce38219a770fc1361cc1ebc59877ffeb09 -
Trigger Event:
push
-
Statement type: