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.
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:
Dev¶
Setup the dev environment using VSCode, it is highly recommended.
Install pre-commit
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.
Releasing¶
It is only possible to release a final version on the master
branch. For it to pass the gates of the publish
workflow, it must have the same version in the tag
, the cookidoo_api/__init__.py
and an entry in the CHANGELOG.md
file.
To release a prerelease version, no changelog entry is required, but it can only happen on a feature branch (not master
branch). Also, prerelease versions are marked as such in the github release page.