Skip to main content

Python script to save recipes directly to a Notion database.

Project description

Notrition

Python script to save recipes directly to a Notion database with the following details:

  • Recipe photo is used as the Page cover photo
  • Recipe name is used as the page name
  • Cook time as a property
  • URL as a property
  • Website name as a property
  • Body of the page contains Ingredients and Steps
  • Absolutely no five paragraph long **life stories from the author

Setup

This guide requires that you have a basic understanding of editing and running Python code.

Notion

First, for this script to work, you need to have a Notion database with the valid fields required by the script. I have a template available for duplication here. You can build and add to this, but make sure not to remove any existing columns.

Second, you need to make an Integration in Notion. Notion has a good tutorial on this here. Remember to save your super secret integration token and keep it somewhere safe! You’ll need this later.

Finally, you’ll need to give your new integration access to the page. You can do this by going to your recipe page and adding your integration from the Share option.

Python

  • Open notion.py
    • Update token with the integration token you saved from earlier
    • Update database_id with the ID of your recipe database.
      • Guide on how to find this is here.

Running

  • Run recipe.py with a single parameter: your recipe URL
  • Bon appétit!

Scraping Library

I used a great recipe scraper as part of this project. Their ReadMe contains a list of websites it supports.

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

notrition-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notrition-0.0.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file notrition-0.0.1.tar.gz.

File metadata

  • Download URL: notrition-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for notrition-0.0.1.tar.gz
Algorithm Hash digest
SHA256 23ac6c142594f9b1117648bbc58894fa94edf649207f58338e680ef84902d658
MD5 2aa592b2996de6f9470cb7cf3afeef9a
BLAKE2b-256 311e52384743f0806702e76db6b1bb5497e6749fb5ad46616bed21c1ef3c55ec

See more details on using hashes here.

File details

Details for the file notrition-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: notrition-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for notrition-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 22481d804f212ddb0ae6cd9f279d6d5ea5738ab78ef1b77bc8085b4ae8d61cc8
MD5 265991495aa5da04fe730aca9a6603ad
BLAKE2b-256 ca7866a8888b80def78237ca21bbc76498ecd032f009f192c6153975ef205571

See more details on using hashes here.

Supported by

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