https://github.com/maxb2/recipe-scrapers-sage
https://github.com/maxb2/recipe-scrapers-sage
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/maxb2/recipe-scrapers-sage
- Owner: maxb2
- Created: 2023-07-24T15:57:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-27T16:39:58.000Z (over 1 year ago)
- Last Synced: 2025-09-22T14:32:18.794Z (9 months ago)
- Language: Python
- Size: 721 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# recipe-scrapers-sage
[](https://github.com/maxb2/recipe-scrapers-sage/actions/workflows/ci.yml)
[](https://codecov.io/github/maxb2/recipe-scrapers-sage)
[](https://pypi.org/project/recipe-scrapers-sage/)
[](https://pypi.org/project/recipe-scrapers-sage/#history)
[](https://libraries.io/pypi/recipe-scrapers-sage)
This is a helper package to save data acquired through [recipe-scrapers](https://github.com/hhursev/recipe-scrapers/) in a format that is importable by [RecipeSage](https://github.com/julianpoy/RecipeSage) ([JSON-LD](https://en.wikipedia.org/wiki/JSON-LD), [implemented here](https://github.com/julianpoy/RecipeSage/blob/master/packages/backend/src/services/json-ld.js#L3-L34)).
## Install
```bash
pip install recipe-scrapers-sage
```
## Usage
To directly export a scraped recipe, use the `export_recipe` function:
```python
from recipe_scrapers import scrape_me
from recipe_scrapers_sage import export_recipe
scraper = scrape_me("")
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:
```python
from recipe_scrapers import scrape_me
from recipe_scrapers_sage import RecipeSage
scraper = scrape_me("")
recipe_sage = RecipeSage.from_scraper(scraper)
recipe_sage.creditText = ""
sage_json: dict = recipe_sage.to_json_ld()
# write `sage_json` to a file that RecipeSage can import
```