No project description provided
Project description
recipe-scrapers-sage
This is a helper package to save data acquired through recipe-scrapers in a format that is importable by RecipeSage (JSON-LD, implemented here).
Install
pip install recipe-scrapers-sage
Usage
To directly export a scraped recipe, use the export_recipe
function:
from recipe_scrapers import scrape_me
from recipe_scrapers_sage import export_recipe
scraper = scrape_me("<RECIPE URL>")
sage_json: dict = export_recipe(scraper)
# write `sage_json` to a file that RecipeSage can import
If you wish to modify a scraped recipe, use the RecipeSage
class:
from recipe_scrapers import scrape_me
from recipe_scrapers_sage import RecipeSage
scraper = scrape_me("<RECIPE URL>")
recipe_sage = RecipeSage.from_scraper(scraper)
recipe_sage.creditText = "<CREDIT TEXT>"
sage_json: dict = recipe_sage.to_json_ld()
# write `sage_json` to a file that RecipeSage can import
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
Close
Hashes for recipe_scrapers_sage-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5aad1e7cfe585c2bc19176f06fe8983df5472d076ae61249331f11ef076ea055 |
|
MD5 | 9947ec480c461c71f447b2da7861dd1e |
|
BLAKE2b-256 | 7e57b189e425e49823d3176a5abb4bad126c53c1c5fff4e2df85d63388065a2d |
Close
Hashes for recipe_scrapers_sage-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b8934f30e16d9ece5932cef4729b9d27a98b6418d58c8dd7e53f68de246857c |
|
MD5 | 093913a1e38ccc762e2e3c53f5e05d9b |
|
BLAKE2b-256 | cd69bbb22ac352b974c91e9bc40c61f4bdd6f12167d0bca5444560e134b03739 |