recipe-scrapers-sage


Namerecipe-scrapers-sage JSON
Version 0.1.0 PyPI version JSON
download
home_page
Summary
upload_time2023-07-27 21:25:19
maintainer
docs_urlNone
authorMatt Anderson
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # recipe-scrapers-sage


[![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/maxb2/recipe-scrapers-sage/ci.yml?branch=main&style=flat-square)](https://github.com/maxb2/recipe-scrapers-sage/actions/workflows/ci.yml)
[![codecov](https://codecov.io/github/maxb2/recipe-scrapers-sage/branch/main/graph/badge.svg?token=UAPS01UJEG)](https://codecov.io/github/maxb2/recipe-scrapers-sage)
[![PyPI](https://img.shields.io/pypi/v/recipe-scrapers-sage?style=flat-square)](https://pypi.org/project/recipe-scrapers-sage/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/recipe-scrapers-sage?style=flat-square)](https://pypi.org/project/recipe-scrapers-sage/#history)
[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/recipe-scrapers-sage?style=flat-square)](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("<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:

```python
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
```
            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "recipe-scrapers-sage",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Matt Anderson",
    "author_email": "matt@manderscience.com",
    "download_url": "https://files.pythonhosted.org/packages/7e/57/b189e425e49823d3176a5abb4bad126c53c1c5fff4e2df85d63388065a2d/recipe_scrapers_sage-0.1.0.tar.gz",
    "platform": null,
    "description": "# recipe-scrapers-sage\n\n\n[![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/maxb2/recipe-scrapers-sage/ci.yml?branch=main&style=flat-square)](https://github.com/maxb2/recipe-scrapers-sage/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/github/maxb2/recipe-scrapers-sage/branch/main/graph/badge.svg?token=UAPS01UJEG)](https://codecov.io/github/maxb2/recipe-scrapers-sage)\n[![PyPI](https://img.shields.io/pypi/v/recipe-scrapers-sage?style=flat-square)](https://pypi.org/project/recipe-scrapers-sage/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/recipe-scrapers-sage?style=flat-square)](https://pypi.org/project/recipe-scrapers-sage/#history)\n[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/recipe-scrapers-sage?style=flat-square)](https://libraries.io/pypi/recipe-scrapers-sage)\n\nThis 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)).\n\n\n## Install\n\n```bash\npip install recipe-scrapers-sage\n```\n\n## Usage\n\nTo directly export a scraped recipe, use the `export_recipe` function:\n\n```python\nfrom recipe_scrapers import scrape_me\nfrom recipe_scrapers_sage import export_recipe\n\nscraper = scrape_me(\"<RECIPE URL>\")\n\nsage_json: dict = export_recipe(scraper)\n\n# write `sage_json` to a file that RecipeSage can import\n```\n\nIf you wish to modify a scraped recipe, use the `RecipeSage` class:\n\n```python\nfrom recipe_scrapers import scrape_me\nfrom recipe_scrapers_sage import RecipeSage\n\nscraper = scrape_me(\"<RECIPE URL>\")\n\nrecipe_sage = RecipeSage.from_scraper(scraper)\n\nrecipe_sage.creditText = \"<CREDIT TEXT>\"\n\nsage_json: dict = recipe_sage.to_json_ld()\n\n# write `sage_json` to a file that RecipeSage can import\n```",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cd69bbb22ac352b974c91e9bc40c61f4bdd6f12167d0bca5444560e134b03739",
                "md5": "093913a1e38ccc762e2e3c53f5e05d9b",
                "sha256": "3b8934f30e16d9ece5932cef4729b9d27a98b6418d58c8dd7e53f68de246857c"
            },
            "downloads": -1,
            "filename": "recipe_scrapers_sage-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "093913a1e38ccc762e2e3c53f5e05d9b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4802,
            "upload_time": "2023-07-27T21:25:18",
            "upload_time_iso_8601": "2023-07-27T21:25:18.096332Z",
            "url": "https://files.pythonhosted.org/packages/cd/69/bbb22ac352b974c91e9bc40c61f4bdd6f12167d0bca5444560e134b03739/recipe_scrapers_sage-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7e57b189e425e49823d3176a5abb4bad126c53c1c5fff4e2df85d63388065a2d",
                "md5": "9947ec480c461c71f447b2da7861dd1e",
                "sha256": "5aad1e7cfe585c2bc19176f06fe8983df5472d076ae61249331f11ef076ea055"
            },
            "downloads": -1,
            "filename": "recipe_scrapers_sage-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9947ec480c461c71f447b2da7861dd1e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3996,
            "upload_time": "2023-07-27T21:25:19",
            "upload_time_iso_8601": "2023-07-27T21:25:19.597710Z",
            "url": "https://files.pythonhosted.org/packages/7e/57/b189e425e49823d3176a5abb4bad126c53c1c5fff4e2df85d63388065a2d/recipe_scrapers_sage-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-27 21:25:19",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "recipe-scrapers-sage"
}
        
Elapsed time: 0.09282s