Skip to main content

No project description provided

Project description

recipe-scrapers-sage

GitHub Workflow Status (with branch) codecov PyPI PyPI - Downloads Libraries.io dependency status for latest release

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

recipe_scrapers_sage-0.1.0.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

recipe_scrapers_sage-0.1.0-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

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