A small command line client for downloading KptnCook recipes. Atm it's only possible to download the three recipes for today. If you know how to get the data for other days/oids of recipes, please let me know :).
Thanks to this blogpost for the url to get the json for today's recipes.
It's in pre alpha status and currently slightly unmaintained. If you want to step in, please let me know.
- Python >=3.10
- Mealie >=v1.0
$ uvx install kptncookUsage: kptncook [OPTIONS] COMMAND [ARGS]...
Options:
--install-completion [bash|zsh|fish|powershell|pwsh]
Install completion for the specified
shell.
--show-completion [bash|zsh|fish|powershell|pwsh]
Show completion for the specified shell,
to copy it or customize the installation.
--help Show this message and exit.
Commands:
backup-favorites Store kptncook favorites in local repository.
delete-recipes Delete recipes from the local repository.
kptncook-access-token Get access token for kptncook.
kptncook-today List all recipes for today from the kptncook...
list-recipes List all locally saved recipes.
save-todays-recipes Save recipes for today from kptncook site.
search-by-id Search for a recipe by id in kptncook api, id...
sync Fetch recipes for today from api, save them to...
sync-with-mealie Sync locally saved recipes with mealie.
export-recipes-to-paprika Export a recipe by id or all recipes to Paprika appUse indices from kptncook list-recipes or pass one or more --oid values.
$ kptncook delete-recipes 0 2
$ kptncook delete-recipes --oid 635a68635100007500061cd7 --oid 635a68635100007500061cd8
$ kptncook delete-recipes 0 --forceFirst, create the configuration directory and .env file:
$ mkdir -p ~/.kptncook
$ touch ~/.kptncook/.envThen set environment variables in the ~/.kptncook/.env file (or directly in your shell). You'll need to set at least the KPTNCOOK_API_KEY variable. If you want to sync the recipes with mealie, you also have to set some additional variables.
Important: The .env file must be created in the ~/.kptncook/ directory, NOT in the installation directory or by editing the kptncook executable.
If you want to back up your favorite receipts from KptnCook, you have to set the KPTNCOOK_ACCESS_TOKEN variable as well. You can obtain the access token by running the kptncook kptncook-access_token command. But you need a kptncook account to do that.
Beware: If you don't have a kptncook account, you'll lose all your favorites by creating a new one.
You can retrieve KptnCook credentials from a password manager instead of typing them interactively. Set these environment variables:
KPTNCOOK_USERNAME_COMMAND: Shell command to retrieve usernameKPTNCOOK_PASSWORD_COMMAND: Shell command to retrieve password
Example for 1Password CLI:
KPTNCOOK_USERNAME_COMMAND="op read op://Personal/KptnCook/username"
KPTNCOOK_PASSWORD_COMMAND="op read op://Personal/KptnCook/password"Example for pass (password-store):
KPTNCOOK_USERNAME_COMMAND="pass show kptncook/username"
KPTNCOOK_PASSWORD_COMMAND="pass show kptncook/password"KPTNCOOK_API_KEY=6q7QNKy-oIgk-IMuWisJ-jfN7s6
KPTNCOOK_ACCESS_TOKEN=9353xxxx-xxxx-4fe1-xxxx-xxx4a173805 # replace with correct token
MEALIE_URL=https://mealie.staging.django-cast.com/api
MEALIE_USERNAME=jochen
MEALIE_PASSWORD=password # replace with correct password
# Optional: Password manager integration
KPTNCOOK_USERNAME_COMMAND="op read op://Personal/KptnCook/username"
KPTNCOOK_PASSWORD_COMMAND="op read op://Personal/KptnCook/password"This error occurs if you accidentally edited the kptncook executable file instead of creating a .env file.
Solution:
- Restore the original
kptncookexecutable (reinstall if needed) - Create the configuration directory:
mkdir -p ~/.kptncook - Create the
.envfile:touch ~/.kptncook/.env - Add your environment variables to
~/.kptncook/.env
This happens when the required environment variables are not set. Make sure you have created the .env file in the correct location (~/.kptncook/.env) and added at least the KPTNCOOK_API_KEY variable.
- Checkout source repository
- Install uv if not already installed
- Install just if not already installed
Install the development environment:
$ uv syncInstall the git pre-commit hooks:
$ uv run pre-commit installThis repo uses Beads for issue tracking, and .beads/ is committed.
$ bd onboardIf bd onboard is not available:
$ bd init
$ bd hooks installIf your global gitignore ignores .beads/, remove **/.beads/ or use git add -f.
$ just lint
$ just typecheck
$ just testTarget a single test:
$ just test-one tests/test_file.py::TestClass::test_caseRun tests using uv:
$ uv run pytestUse the local beadsflow checkout:
$ just beadsflow-dry <epic-id>
$ just beadsflow-once <epic-id>
$ just beadsflow-run <epic-id>Import GitHub issues into Beads epics (open issues by default), including
comments. The importer is idempotent and uses external_ref as gh-<number>.
$ just beads-import-gh-issues
$ just beads-import-gh-issues --repo OWNER/REPO --state open --limit 500
$ just beads-import-gh-issues --dry-runAfter running the tests, publish the package to PyPI using uv:
$ uv publish --token your_token