Reference¶
Cookidoo API package.
Cookidoo
¶
Unofficial Cookidoo API interface.
Init function for Cookidoo API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
ClientSession
|
The client session for aiohttp requests.
Must use a |
required |
cfg
|
CookidooConfig
|
Cookidoo config |
CookidooConfig()
|
on_auth_data_update
|
Callable[[CookidooAuthData], None] | None
|
Optional callback invoked with the new :class: |
None
|
Source code in cookidoo_api/cookidoo.py
localization
property
¶
Localization.
api_endpoint
property
¶
Get the api endpoint.
Returns the cookidoo domain derived from the localization URL,
e.g. https://cookidoo.ch or https://cookidoo.co.uk.
auth_data
property
¶
The current OAuth2 tokens, for persistence. None until logged in.
on_auth_data_update
property
writable
¶
The callback notified whenever the tokens change.
Called with the new :class:CookidooAuthData after a login and after
every refresh, including the transparent one a request performs when
the access token has expired. The server rotates the refresh token
along with the access token, so a consumer that persists the tokens
should store what the callback hands it, rather than only the result of
an explicit :meth:login.
Not called by :meth:apply_auth_data or :meth:load_token, which
restore tokens the consumer already holds.
Exceptions raised by the callback are caught and logged: a consumer failing to store the tokens must not break the request that triggered the refresh.
apply_auth_data
¶
Restore a previous login from persisted tokens (no network call).
The access token is refreshed automatically on the next request if it has expired.
Source code in cookidoo_api/cookidoo.py
begin_login
async
¶
Return an authorization URL for a browser or another external agent.
No email/password is submitted. State and the PKCE verifier stay in
this instance for five minutes. Starting again invalidates the old
attempt. The caller opens the URL and passes the full registered
redirect URL to :meth:complete_login.
This method does not launch a browser or register a redirect handler. It cannot make an unregistered redirect URI acceptable to Cookidoo.
Source code in cookidoo_api/cookidoo.py
cancel_login
¶
complete_login
async
¶
Validate and consume a browser callback, then exchange its code once.
Every completion attempt consumes the pending state, including an invalid callback or a failed exchange. Start a new attempt after any failure; an uncertain token request is never retried automatically. The callback, authorization code and PKCE verifier are not logged. Existing token callbacks and automatic refresh work as after login().
Source code in cookidoo_api/cookidoo.py
login
async
¶
Perform an OAuth2 authorization-code + PKCE login.
Signs in with the configured email/password against the CIAM identity
provider, exchanges the resulting code for an access/refresh token, and
authenticates all subsequent API calls via a Bearer header:
- discover the OIDC endpoints
- open the authorize endpoint to reach the CIAM login form
- POST the credentials to the CIAM login service
- capture the
codefrom the redirect to the app scheme - exchange the code for tokens (public client, PKCE, no secret)
The login redirects still rely on the session cookie jar, so a
CookieJar(unsafe=True) session is required. The login requests carry
a browser-like User-Agent (request-scoped only) since the flow is
served behind Cloudflare.
Raises:
| Type | Description |
|---|---|
CookidooConfigException
|
If the OAuth2 client id or redirect uri was overridden with an empty value. |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the login page cannot be parsed. |
CookidooAuthException
|
If the login fails due to invalid credentials. |
Source code in cookidoo_api/cookidoo.py
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | |
refresh
async
¶
Refresh the access token using the stored refresh token.
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
If there is no refresh token or the refresh is rejected. |
CookidooConfigException
|
If the OAuth2 client id or redirect uri was overridden with an empty value. |
CookidooRequestException
|
If the discovery or token request fails or times out. |
Source code in cookidoo_api/cookidoo.py
save_token
¶
Save the OAuth2 tokens to a file for later reuse.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to the file where the tokens will be saved. |
required |
Source code in cookidoo_api/cookidoo.py
load_token
¶
Restore the OAuth2 tokens from a file saved with :meth:save_token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to the file containing the saved tokens. |
required |
Raises:
| Type | Description |
|---|---|
CookidooConfigException
|
If the token file cannot be read or parsed. |
Source code in cookidoo_api/cookidoo.py
get_user_info
async
¶
Get user info.
Returns:
| Type | Description |
|---|---|
CookidooUserInfo
|
The user info |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
get_active_subscription
async
¶
Get active subscription if any.
Returns:
| Type | Description |
|---|---|
CookidooSubscription
|
The active subscription |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
get_devices
async
¶
Get the Thermomix appliances paired to the account.
Returns:
| Type | Description |
|---|---|
list[CookidooDevice]
|
The paired appliances, identified by machine type (e.g. |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
get_monitored_device_ids
async
¶
Get the appliance IDs currently available for remote monitoring.
Note this is distinct from :meth:get_devices (all paired appliances):
an appliance only appears here while it is online/reachable for
monitoring, and the identifier is the opaque remote-monitoring device id.
Returns:
| Type | Description |
|---|---|
list[str]
|
The remote-monitoring device ids (empty when none are available). |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
register_push_token
async
¶
Register a push token to receive remote-monitoring cook-state updates.
Appliance state is delivered as a Firebase Cloud Messaging data message
to the registered token; obtaining the token and receiving the messages
is the caller's responsibility. Decode received payloads with
:func:cookidoo_api.cooking_activity_from_push.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
push_token
|
str
|
The FCM registration token to deliver updates to. |
required |
mobile_app_id
|
str
|
A stable per-installation identifier for this client. |
required |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
unregister_push_token
async
¶
Unregister a previously registered push token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
push_token
|
str
|
The FCM registration token to stop delivering updates to. |
required |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
get_recipe_details
async
¶
Get recipe details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The id of the recipe |
required |
Returns:
| Type | Description |
|---|---|
CookidooShoppingRecipeDetails
|
The recipe details |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
search_recipes
async
¶
Search recipes in Cookidoo (GET).
Uses the same API base as the rest of the client (api_endpoint): {api_endpoint}/search/{locale}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str | None
|
Optional search query (e.g. "chicken", "pasta"). |
None
|
locale
|
str | None
|
Locale for the search path (e.g. "es", "en", "de"). Defaults to the first part of the configured language (e.g. "de-CH" -> "de"). |
None
|
accessories
|
str | list[str] | None
|
Optional comma-separated accessory filters (e.g. "includingFriend,includingBladeCover,includingBladeCoverWithPeeler,includingCutter,includingSensor"). |
None
|
languages
|
str | list[str] | None
|
Optional comma-separated language codes (e.g. "en,es"). |
None
|
categories
|
str | list[str] | None
|
Optional comma-separated category IDs. |
None
|
countries
|
str | list[str] | None
|
Optional comma-separated country codes (e.g. "ar"). |
None
|
ingredients
|
str | list[str] | None
|
Optional comma-separated ingredients. |
None
|
exclude_ingredients
|
str | list[str] | None
|
Optional comma-separated excluded ingredients. |
None
|
tags
|
str | list[str] | None
|
Optional comma-separated tags. |
None
|
ratings
|
str | list[str] | None
|
Optional comma-separated ratings (e.g. "5,4"). |
None
|
difficulty
|
str | None
|
Optional difficulty (e.g. "easy", "medium", "hard"). |
None
|
preparation_time
|
int | None
|
Optional preparation time in seconds. |
None
|
total_time
|
int | None
|
Optional total time in seconds. |
None
|
portions
|
int | None
|
Optional portions count. |
None
|
page
|
int | None
|
Optional page number (API-dependent, often 0- or 1-based). |
None
|
page_size
|
int | None
|
Optional page size (API-dependent; common keys: pageSize). |
None
|
tmv
|
ThermomixMachineType | str | list[ThermomixMachineType | str] | None
|
Optional Thermomix machine version. Use |
None
|
Returns:
| Type | Description |
|---|---|
CookidooSearchResult
|
Search result with recipes and total count. |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore. |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 | |
get_custom_recipe
async
¶
Get custom recipe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The id of the custom recipe |
required |
Returns:
| Type | Description |
|---|---|
CookidooCustomRecipe
|
The custom recipe |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
list_custom_recipes
async
¶
List custom recipes.
Source code in cookidoo_api/cookidoo.py
add_custom_recipe_from
async
¶
Add custom recipe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipeId
|
str
|
The base recipe to copy |
required |
servingSize
|
int
|
The serving size of the custom recipe |
required |
Returns:
| Type | Description |
|---|---|
CookidooCustomRecipe
|
The added custom recipe |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
remove_custom_recipe
async
¶
Remove custom recipe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
custom_recipe_id
|
str
|
The custom recipe id to remove |
required |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
create_custom_recipe
async
¶
Create, populate, and return a custom recipe.
Creation uses a stub POST followed by a PATCH with the full
payload and a final GET reload. If the populate or reload step
fails after the stub was created, the orphaned recipe id is attached
to the raised exception via Exception.add_note.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the recipe input fails local validation. |
CookidooAuthException
|
When the access token is not valid anymore. |
CookidooRequestException
|
If a request fails after the stub may already exist server-side. |
CookidooParseException
|
If a response cannot be parsed after the stub may already exist. |
Source code in cookidoo_api/cookidoo.py
1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 | |
update_custom_recipe
async
¶
Update selected fields and return the refreshed custom recipe.
Source code in cookidoo_api/cookidoo.py
1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 | |
get_shopping_list_recipes
async
¶
Get recipes.
Returns:
| Type | Description |
|---|---|
list[CookidooShoppingRecipe]
|
The list of the recipes |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
get_ingredient_items
async
¶
Get ingredient items.
Returns:
| Type | Description |
|---|---|
list[CookidooIngredientItem]
|
The list of the ingredient items |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
add_ingredient_items_for_recipes
async
¶
Add ingredient items for recipes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe_ids
|
list[str]
|
The recipe ids for the ingredient items to add to the shopping list |
required |
Returns:
| Type | Description |
|---|---|
list[CookidooIngredientItem]
|
The list of the added ingredient items |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
remove_ingredient_items_for_recipes
async
¶
Remove ingredient items for recipes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe_ids
|
list[str]
|
The recipe ids for the ingredient items to remove to the shopping list |
required |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
edit_ingredient_items_ownership
async
¶
Edit ownership ingredient items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ingredient_items
|
list[CookidooIngredientItem]
|
The ingredient items to change the the |
required |
Returns:
| Type | Description |
|---|---|
list[CookidooIngredientItem]
|
The list of the edited ingredient items |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
add_ingredient_items_for_custom_recipes
async
¶
Add ingredient items for custom recipes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe_ids
|
list[str]
|
The recipe ids for the ingredient items to add to the shopping list |
required |
Returns:
| Type | Description |
|---|---|
list[CookidooIngredientItem]
|
The list of the added ingredient items |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
remove_ingredient_items_for_custom_recipes
async
¶
Remove ingredient items for custom recipes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe_ids
|
list[str]
|
The custom recipe ids for the ingredient items to remove to the shopping list |
required |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
get_additional_items
async
¶
Get additional items.
Returns:
| Type | Description |
|---|---|
list[CookidooAdditionalItem]
|
The list of the additional items |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
add_additional_items
async
¶
Create additional items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
additional_item_names
|
list[str]
|
The additional item names to create, only the label can be set, as the default state |
required |
Returns:
| Type | Description |
|---|---|
list[CookidooAdditionalItem]
|
The list of the added additional items |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
edit_additional_items
async
¶
Edit additional items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
additional_items
|
list[CookidooAdditionalItem]
|
The additional items to change the the |
required |
Returns:
| Type | Description |
|---|---|
list[CookidooAdditionalItem]
|
The list of the edited additional items |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
edit_additional_items_ownership
async
¶
Edit ownership additional items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
additional_items
|
list[CookidooAdditionalItem]
|
The additional items to change the the |
required |
Returns:
| Type | Description |
|---|---|
list[CookidooAdditionalItem]
|
The list of the edited additional items |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
remove_additional_items
async
¶
Remove additional items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
additional_item_ids
|
list[str]
|
The additional item ids to remove |
required |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
clear_shopping_list
async
¶
Remove all additional items, ingredients and recipes.
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
count_managed_collections
async
¶
Get managed collections.
Returns:
| Type | Description |
|---|---|
tuple[int, int]
|
The number of managed collections and the number of pages |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
get_managed_collections
async
¶
Get managed collections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
int
|
The page of the managed collections |
0
|
Returns:
| Type | Description |
|---|---|
list[CookidooCollection]
|
The list of the managed collections |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
add_managed_collection
async
¶
Add managed collections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
managed_collection_id
|
str
|
The managed collection id to add |
required |
Returns:
| Type | Description |
|---|---|
CookidooCollection
|
The added managed collection |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
remove_managed_collection
async
¶
Remove managed collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
managed_collection_id
|
str
|
The managed collection id to remove |
required |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
count_custom_collections
async
¶
Get custom collections.
Returns:
| Type | Description |
|---|---|
tuple[int, int]
|
The number of custom collections and the number of pages |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
get_custom_collections
async
¶
Get custom collections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
int
|
The page of the custom collections |
0
|
Returns:
| Type | Description |
|---|---|
list[CookidooCollection]
|
The list of the custom collections |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
add_custom_collection
async
¶
Add custom collections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
custom_collection_name
|
str
|
The custom collection name to add |
required |
Returns:
| Type | Description |
|---|---|
CookidooCollection
|
The added custom collection |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
remove_custom_collection
async
¶
Remove custom collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
custom_collection_id
|
str
|
The custom collection id to remove |
required |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
add_recipes_to_custom_collection
async
¶
Add recipes to a custom collections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
custom_collection_id
|
str
|
The custom collection to add the recipes to |
required |
recipe_ids
|
list[str]
|
The recipe ids to add to a custom collection |
required |
Returns:
| Type | Description |
|---|---|
CookidooCollection
|
The changed custom collection |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
remove_recipe_from_custom_collection
async
¶
Remove recipe from a custom collections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
custom_collection_id
|
str
|
The custom collection to remove the recipe from |
required |
recipe_id
|
str
|
The recipe id to remove from a custom collection |
required |
Returns:
| Type | Description |
|---|---|
CookidooCollection
|
The changed custom collection |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
get_recipes_in_calendar_week
async
¶
Get recipes in a calendar week.
The planning endpoint returns catalogue recipes in full but custom
(user-created) recipes only as customerRecipeIds. By default those
IDs are exposed as-is on :attr:CookidooCalendarDay.customer_recipe_ids
and are not part of :attr:CookidooCalendarDay.recipes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
day
|
date
|
The date specifying the calendar week |
required |
resolve_custom_recipes
|
bool
|
When |
False
|
Returns:
| Type | Description |
|---|---|
list[CookidooCalendarDay]
|
The list of the calendar days with recipes |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
add_recipes_to_calendar
async
¶
Add recipes to a calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
day
|
date
|
The date to add the recipes to in the calendar |
required |
recipe_ids
|
list[str]
|
The recipe ids to add to the calendar |
required |
Returns:
| Type | Description |
|---|---|
CookidooCalendarDay
|
The changed calendar day |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
remove_recipe_from_calendar
async
¶
Remove recipe from calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
day
|
date
|
The date to remove the recipe from in the calendar |
required |
recipe_id
|
str
|
The recipe id to remove from the calendar |
required |
Returns:
| Type | Description |
|---|---|
CookidooCalendarDay
|
The changed calendar day |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
add_custom_recipes_to_calendar
async
¶
Add custom recipes to a calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
day
|
date
|
The date to add the custom recipes to in the calendar |
required |
recipe_ids
|
list[str]
|
The recipe ids to add to the calendar |
required |
Returns:
| Type | Description |
|---|---|
CookidooCalendarDay
|
The changed calendar day |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
remove_custom_recipe_from_calendar
async
¶
Remove custom recipe from calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
day
|
date
|
The date to remove the custom recipe from in the calendar |
required |
recipe_id
|
str
|
The custom recipe id to remove from the calendar |
required |
Returns:
| Type | Description |
|---|---|
CookidooCalendarDay
|
The changed calendar day |
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If the request fails. |
CookidooParseException
|
If the parsing of the request response fails. |
Source code in cookidoo_api/cookidoo.py
CookidooAuthException
¶
Bases: CookidooException
When an authentication error is encountered.
CookidooConfigException
¶
Bases: CookidooException
When the config is invalid.
CookidooParseException
¶
Bases: CookidooException
When data could not be parsed.
CookidooRequestException
¶
Bases: CookidooException
When a request returns an error.
CookidooResponseException
¶
Bases: CookidooException
When a response could not be parsed.
CookidooUnavailableException
¶
Bases: CookidooException
When the network or server is not available.
CookidooRemoteMonitoring
¶
Receives live cook state for the appliances of an account.
The FCM credentials are worth persisting: reusing them keeps the same push
token across restarts instead of leaving a new one registered every time.
Pass them back in via credentials and keep them fresh with
on_credentials.
Init the remote monitoring receiver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cookidoo
|
Cookidoo
|
A logged-in client, used to register and unregister the push token. |
required |
on_cooking_activity
|
Callable[[CookidooCookingActivity], None]
|
Called with every decoded cook-state update. Invoked from the event loop the receiver runs on. |
required |
mobile_app_id
|
str
|
A stable per-installation identifier for this client. |
required |
session
|
ClientSession | None
|
Client session for the Firebase requests. A private one is created when omitted. |
None
|
credentials
|
dict[str, Any] | None
|
FCM credentials from a previous run, to reuse its push token. |
None
|
on_credentials
|
Callable[[dict[str, Any]], None] | None
|
Called whenever the FCM credentials change, for persistence. |
None
|
Source code in cookidoo_api/remote_monitoring.py
credentials
property
¶
The current FCM credentials, for persistence.
token
property
¶
The current FCM registration token. None until started.
is_connected
property
¶
Whether the receiver is logged in and able to receive pushes.
start
async
¶
Start listening and register for cook-state pushes.
Raises:
| Type | Description |
|---|---|
CookidooAuthException
|
When the access token is not valid anymore |
CookidooRequestException
|
If registering the push token fails. |
CookidooParseException
|
If the remote-monitoring endpoints cannot be resolved. |
Source code in cookidoo_api/remote_monitoring.py
stop
async
¶
Stop listening and drop the push token registration.
Source code in cookidoo_api/remote_monitoring.py
CookidooAdditionalItem
dataclass
¶
CookidooAuthData
dataclass
¶
OAuth2 tokens obtained from a login, for persistence and restore.
expires_at is a POSIX timestamp (seconds) for the access token.
CookidooCategory
dataclass
¶
CookidooChapter
dataclass
¶
Cookidoo chapter type.
Attributes:
| Name | Type | Description |
|---|---|---|
title |
The title of the chapter |
|
recipes |
list[CookidooChapterRecipe]
|
The recipes in the chapter |
CookidooChapterRecipe
dataclass
¶
CookidooCollection
dataclass
¶
Cookidoo collection type.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The id of the collection |
title |
The title of the collection |
|
description |
str | None
|
The description of the collection |
chapters |
list[CookidooChapter]
|
The recipes in the collection |
CookidooConfig
dataclass
¶
Cookidoo config type.
Attributes:
| Name | Type | Description |
|---|---|---|
localization |
CookidooLocalizationConfig
|
The localization for the api including country, language and url |
email |
str
|
The email to login |
password |
str
|
The password to login |
client_id |
str
|
The OAuth2 client id to run the login flow as |
redirect_uri |
str
|
The OAuth2 redirect uri registered for |
The login runs as a public client (authorization code + PKCE, no client |
|
|
secret), so both values are public identifiers rather than credentials and |
|
|
they default to the ones of the Cookidoo mobile app. Callers do not need to |
|
|
set them; see ``docs/oauth-client.md``. |
|
CookidooCookingActivity
dataclass
¶
Live cook state pushed by an appliance's remote monitoring.
Values the recipe does not provide are None (the app renders "---"
for an unset current temperature, which is normalised to None here).
is_active
property
¶
Whether a cook is currently running or paused.
CookidooCreateCustomRecipe
dataclass
¶
Input model for creating a custom recipe.
CookidooCustomAnnotation
dataclass
¶
Extensible annotation for API types not modeled by this library.
CookidooCustomRecipe
dataclass
¶
Cookidoo custom recipe type.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The id of the recipe |
name |
str
|
The label of the recipe |
ingredients |
list[str]
|
The ingredients of the recipe |
instructions |
list[str | CookidooInstruction]
|
The instructions of the recipe |
tools |
list[str]
|
The tools needed for the recipe |
serving_size |
int
|
The service size of the recipe |
active_time |
int
|
The time needed preparing the recipe [in seconds] |
total_time |
int
|
The time needed until the recipe is ready [in seconds] |
thumbnail |
str | None
|
The thumbnail image URL (small preview) |
image |
str | None
|
The full-size image URL |
url |
str
|
The URL of the recipe |
CookidooDevice
dataclass
¶
A paired Thermomix appliance on the account.
CookidooIngredient
dataclass
¶
Cookidoo ingredient type.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The id of the ingredient |
name |
str
|
The label of the ingredient |
description |
str
|
The description of the item, including the quantity or other helpful information |
preparation |
str | None
|
How the ingredient is to be prepared ("peeled", ", in pieces"), as sent
by the API. |
CookidooIngredientAnnotation
dataclass
¶
Reference an ingredient occurrence within an instruction.
CookidooIngredientItem
dataclass
¶
Bases: CookidooItem
Cookidoo ingredient item type.
Attributes:
| Name | Type | Description |
|---|---|---|
description |
str
|
The description of the item, including the quantity or other helpful information |
preparation |
str | None
|
How the ingredient is to be prepared (", in pieces"), as sent by the API.
|
CookidooInstruction
dataclass
¶
Recipe instruction with optional guided-cooking settings.
CookidooItem
dataclass
¶
CookidooLocalizationConfig
dataclass
¶
A localization config class.
CookidooModeAnnotation
dataclass
¶
Thermomix mode settings anchored to an instruction slot.
CookidooRecipeCollection
dataclass
¶
CookidooSearchRecipeHit
dataclass
¶
CookidooSearchResult
dataclass
¶
Cookidoo search result type.
Attributes:
| Name | Type | Description |
|---|---|---|
recipes |
list[CookidooSearchRecipeHit]
|
List of recipe hits matching the search |
total |
int
|
Total number of matching recipes |
CookidooShoppingRecipe
dataclass
¶
Cookidoo shopping recipe type.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The id of the recipe |
name |
str
|
The label of the recipe |
ingredients |
list[CookidooIngredient]
|
The ingredients of the recipe |
thumbnail |
str | None
|
The thumbnail image URL (small preview) |
image |
str | None
|
The full-size image URL |
url |
str
|
The URL of the recipe |
CookidooShoppingRecipeDetails
dataclass
¶
Bases: CookidooShoppingRecipe
Cookidoo recipe details type.
Attributes:
| Name | Type | Description |
|---|---|---|
difficulty |
str
|
The difficulty of the recipe |
notes |
list[str]
|
Hints and additional information about the recipe |
categories |
list[CookidooCategory]
|
The categories of the recipe |
collections |
list[CookidooRecipeCollection]
|
The collections of the recipe |
utensils |
list[str]
|
The utensils needed for the recipe |
serving_size |
int
|
The service size of the recipe |
active_time |
int
|
The time needed preparing the recipe [in seconds] |
total_time |
int
|
The time needed until the recipe is ready [in seconds] |
nutrition_groups |
list[CookidooNutritionGroup]
|
The nutrition groups of the recipe (from API, may be empty) |
step_groups |
list[CookidooRecipeStepGroup]
|
The grouped cooking instructions for the recipe (from API, may be empty). Instruction text is returned as HTML markup, as sent by the API. |
CookidooStepSettings
dataclass
¶
Structured guided-cooking settings for an instruction.
CookidooSubscription
dataclass
¶
A subscription class.
CookidooTemperatureSetting
dataclass
¶
Temperature value used by an instruction annotation.
CookidooTTSAnnotation
dataclass
¶
Text-to-speech cooking settings anchored to an instruction slot.
CookidooUpdateCustomRecipe
dataclass
¶
Partial update model for an existing custom recipe.
image=None reuses the existing customer-recipe photo when its path can
be recovered. A supplied image must be a customer-recipe path or filename;
Cookidoo may reject an image that belongs to a different recipe.
CookidooUserInfo
dataclass
¶
A user info class.
cooking_activity_from_push
¶
Convert a remote-monitoring push payload into a cooking activity.
Appliance state is delivered out of band (a Firebase Cloud Messaging data
message) rather than as an HTTP response, so consumers receive it via their
own push channel and decode it here. Both the on-the-wire field names
(leadingText/trailingText/completedDate/staleDate/…) and the
app's parsed names are accepted.
Source code in cookidoo_api/helpers.py
get_country_options
async
¶
get_language_options
async
¶
get_localization_options
async
¶
Get a list of possible localization options.