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
Metadata
Release files for recipe-scrapers-sage 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| recipe_scrapers_sage-0.1.0.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| recipe_scrapers_sage-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / recipe_scrapers_sage-0.1.0.tar.gz
| Download URL | recipe_scrapers_sage-0.1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5aad1e7cfe585c2bc19176f06fe8983df5472d076ae61249331f11ef076ea055
|
|
BLAKE2b-256 checksum How to use checksums |
7e57b189e425e49823d3176a5abb4bad126c53c1c5fff4e2df85d63388065a2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.9.7 Darwin/22.5.0
|
Release files / recipe_scrapers_sage-0.1.0-py3-none-any.whl
| Download URL | recipe_scrapers_sage-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3b8934f30e16d9ece5932cef4729b9d27a98b6418d58c8dd7e53f68de246857c
|
|
BLAKE2b-256 checksum How to use checksums |
cd69bbb22ac352b974c91e9bc40c61f4bdd6f12167d0bca5444560e134b03739
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.9.7 Darwin/22.5.0
|