Skip to main content

Unofficial package to access Cookidoo.

Project description

Cookidoo API

PyPI version

An unofficial python package to access Cookidoo.

Unit tests Smoke test Ruff Mypy Markdownlint

GitHub Patreon BuyMeACoffee PayPal

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.

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.

CHANGELOG

0.6.0

  • add a method to get the recipes on a shopping list

0.5.0

  • add localization getter for the Cookidoo instance

0.4.0

  • switch from web automation to proper API (based on Android App)

0.3.0

  • add check method to quickly verify browser functionality

0.2.0

  • add method to add items when in free account
  • auto-close feedback modal when in free account

0.1.1

  • fix build

0.1.0

Initial commit.

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

cookidoo_api-0.6.0.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

cookidoo_api-0.6.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file cookidoo_api-0.6.0.tar.gz.

File metadata

  • Download URL: cookidoo_api-0.6.0.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cookidoo_api-0.6.0.tar.gz
Algorithm Hash digest
SHA256 3cced468371e5d3b562e07b3cea643f2f5175b9fcda5a6d5238a424a5e30c3cb
MD5 398f05d35b0d1b99bc6a6d16fada2dd3
BLAKE2b-256 ee25bd04d217ec2de9c6322555817ca3a2cf2bbb23f6a22ffff2b0ece0c3f1f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for cookidoo_api-0.6.0.tar.gz:

Publisher: publish-to-pypi.yml on miaucl/cookidoo-api

Attestations:

File details

Details for the file cookidoo_api-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: cookidoo_api-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cookidoo_api-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3fe94ab5788621778161ffd386ed15f36287844422447d97a29df8f584dd19b
MD5 00b2799d23d607f097283612b60b37ab
BLAKE2b-256 226e5f1aec54ac65c6760cd07b923be428c46d9560188d72e5b895ec6716371d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cookidoo_api-0.6.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on miaucl/cookidoo-api

Attestations:

Supported by

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