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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23ac6c142594f9b1117648bbc58894fa94edf649207f58338e680ef84902d658
|
|
| MD5 |
2aa592b2996de6f9470cb7cf3afeef9a
|
|
| BLAKE2b-256 |
311e52384743f0806702e76db6b1bb5497e6749fb5ad46616bed21c1ef3c55ec
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22481d804f212ddb0ae6cd9f279d6d5ea5738ab78ef1b77bc8085b4ae8d61cc8
|
|
| MD5 |
265991495aa5da04fe730aca9a6603ad
|
|
| BLAKE2b-256 |
ca7866a8888b80def78237ca21bbc76498ecd032f009f192c6153975ef205571
|