Skip to main content

Setup

Run pip install paprika2notion

V0 of this library will assume you have downloaded and extracted your recipes to some path that we will refer to as: path/to/your/extracted/recipe.paprikarecipe.yaml

For help doing this, check out: paprika-recipes

You must then create a Notion database that provides write-access to a Notion integration. For details on setting up a Notion integration, see their website here

This database must contain, at minimum the following fields. Note that spelling matters, as the names are used for writing the template.:

  • Title: Recipe
  • Rich Text: Recipe write-up, Recipe write-up overflow, Paprika Hash, Nutritional Info
  • Select: Status, Meal Type, Tags
  • URL: URL

If you wish for a different field-set, you can edit the NotionRecipe's get_all_properties method.

The library reads your secrets from environment variables. See the snippet below for expected variables. I recommend using a secrets manager like Hashicorp Vault (not sponsored) to enable this. Otherwise, you can create a local config file.

Usage

This library is intended to make it easy for you to load recipes you have stored in Paprika into your Notion Workspace.

Once you have downloaded and extracted your recipes, you can load them as objects in python, edit them, and write to notion if you wish.

See below for an example writing a single recipe to my Notion database.

#%%
from __future__ import annotations
import os
import yaml
from paprika2notion import PaprikaRecipe, NotionRecipe
from notion_client import Client

c = Client(auth=os.environ["NOTION_TOKEN"])

with open("path/to/your/extracted/recipe.paprikarecipe.yaml", 'r', encoding='utf8') as f:
    t = PaprikaRecipe.from_dict(yaml.load(f, Loader=yaml.loader.Loader))

n = NotionRecipe.from_paprika(t)
n.write_to_notion(c, os.environ["NOTION_DATABASE_ID"])

By default, the tool will do a few things:

  • All categories in Paprika become Tags in Notion
  • Status and Meal Type are set to From Paprika, to enable you to identify recipes that may need touching up in Notion.
  • Paprika's Directions are written to Recipe write-up, and if > 2000 characters, overflow goes to Recipe write-up overflow

Contribution

There are a number of ways to contribute to paprika2notion.

  • Check out open Issues and submit a PR to resolve one

    • if you don't want to submit a PR, feel free to join the discussion on these issues anyways!
  • Use the tool and make improvements to solve your pain points

    • Find something annoying? We'd love your help fixing it! Anything that could make this a more seamless tool is probably welcome.
  • Some planned items that you're free to take a stab at before I get to them:

    • Automatically create appropriate Database/Page/Schema in Notion from tool
    • Automatically add all ingredient relations
      • If ingredient doesn't exist, create an appropriate one
  • Just ask! Feel free to reach out to me and ask if there's anything you can do to help with the project. Almost certainly we have some backlog items.

With any pull request, please include at minimum:

  • Doc strings for any major functions/methods.
  • a test case walkthrough.

If you're feeling especially helpful create a test using pytest and run it with cov after your changes.

Release files for paprika2notion 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paprika2notion 0.1
File Size Uploaded
paprika2notion-0.1.tar.gz 22.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for paprika2notion 0.1
File Interpreter ABI Platform
paprika2notion-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 47.2 kB

Release files / paprika2notion-0.1.tar.gz

Download URL paprika2notion-0.1.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
388725882faba4d638d2861e592fbc9138387c250d159bd06a74c28133032cec
BLAKE2b-256 checksum
How to use checksums
03ab1b5d69951a147e907e7a777004dd0e816ba78c804502908d154e484dd9d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.4

Release files / paprika2notion-0.1-py3-none-any.whl

Download URL paprika2notion-0.1-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3682ea34de9c9b0dbb1d03e207d942658bde885288c9ae1b667b38c0bbe0af02
BLAKE2b-256 checksum
How to use checksums
cb877fdb881c31a5e2bbb169188d4290e5eee9f020b49649bcc5ea38a6c062f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.4

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page