ChefScript


NameChefScript JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryAn esolang for storing, creating and using recipes
upload_time2022-12-13 12:35:34
maintainer
docs_urlNone
author
requires_python>=3.10
license# Copyright 2022 Yuanhao Chen Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords chefscript recipe cooking esolang esoteric
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ChefScript: an esolang for storing, creating and using recipes

## Installation

```bash
pip install ChefScript
```

## Usage

```bash
ChefScript [-h] [<filename>]
```

## Example of usage

### ChefScript code

```text
seasoned steak
    2 lb of New York strip steak (pat dry)
    1 1/2 tsp of salt (apply onto both sides)
    1 tsp of black pepper (
        apply onto both sides,
        rub in
    )

cook seasoned steak with 1 lb of New York strip steak
```

### Output

```text
--------------------Cooking seasoned steak with scale 0.500 --------------------
Recipe for seasoned steak:
    Summary of ingredients:
        1.000 lb of New York strip steak
        0.500 tsp of black pepper
        0.750 tsp of salt
    Instructions:
        1.000 lb of New York strip steak (pat dry)
        0.750 tsp of salt (apply onto both sides)
        0.500 tsp of black pepper (
        apply onto both sides,
        rub in
    )
--------------------------------------------------------------------------------
```

## Components of ChefScript

### Number

A `number` in ChefScript is a list of whitespace-separated floats or quotients (fraction of two floats). Its value is the sum of all floats and quotients in the list.

```text
1/2 (this is 0.500)
1 1/2 (this is 1.500)
1.3e2 15 .5e1 (this is 150.000)
```

The purpose of this design is to make it possible to write `1 1/2` like a recipe book will do, instead of `1.5` which is less commonly used.

### Quantity

A `quantity` is a `number` followed by a `unit`. It is recommended to write a `unit` case-insensitively (`mL` is different from `ML`, but `mL` is the same as `ml`), and using spaces to separate words (`fl oz` or `fl. oz.` looks better than `fl_oz`). It is recommended but not mandatory to put a space between the `number` and the `unit`.

```text
1 cup
1 1/2 cups
50 fl oz
```

### Ingredient

An `ingredient` is a `quantity` followed by the keyword `of` and a `name`. It is recommended to write a `name` using spaces to separate words (`chicken breast` looks better than `chicken_breast`), but sometimes an underscore as to be used when a word is in conflict with a keyword.

```text
1 lb of chicken breast
```

### Recipe

A `recipe` is a `name` followed by a list of `ingredient`s or other `recipe`s, and optionally together with a list of `instruction`s. The `name` follows the same rules as an `ingredient`'s `name`. The `instruction` is a comment that starts on the same line as an `ingredient` or a `recipe` inside the `recipe`.

```text
seasoned steak
    2 lb of New York strip steak (pat dry)
    (
        you can put a comment here as well,
        but it won't be recognised as an instruction.
    )
    1 1/2 tsp of salt (apply onto both sides)
    1 tsp of black pepper (
        apply onto both sides,
        rub in
    )
```

When an `ingredient` is mentioned more than once in a `recipe`, it will be considered a new one each time, and the quantities will be added together. When a `recipe` is mentioned more than once in a `recipe`, it will be considered the same reused, and the quantities will not be added together.

### Comment

A `comment` starts with `(` and ends with `)`. It can be placed at the end of any line, and can run for multiple lines. When put at the end of a line with an `ingredient` or a `recipe`, it will be recognised as an `instruction`.

```text
(
    this is a comment
    that runs for multiple lines
)
```

### Function

Currently, there is only one built-in function in ChefScript, which is `cook`. It takes a `recipe` and an optional `scale` as arguments, and prints out the recipe with the scale applied to all quantities. The `scale` can be a `number` or an `ingredient`, recognised by different keywords used with `cook`.

```text
cook seasoned steak
cook seasoned steak for 2 times
cook seasoned steak with 1 lb of New York strip steak
```

### Keywords and delimiters

The keywords are

```text
of
cook
for
times
with
```

The delimiters are

```text
(
)
```

These should be avoided in `name`s.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ChefScript",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "ChefScript,recipe,cooking,esolang,esoteric",
    "author": "",
    "author_email": "Yuanhao 'Nyoeghau' Chen <nyoeghau@nyoeghau.com>",
    "download_url": "https://files.pythonhosted.org/packages/d3/d7/5b9b4b995a25d362b73d777624c8e379695c87b715a1250cb4ba623b3cba/ChefScript-0.1.1.tar.gz",
    "platform": null,
    "description": "# ChefScript: an esolang for storing, creating and using recipes\n\n## Installation\n\n```bash\npip install ChefScript\n```\n\n## Usage\n\n```bash\nChefScript [-h] [<filename>]\n```\n\n## Example of usage\n\n### ChefScript code\n\n```text\nseasoned steak\n    2 lb of New York strip steak (pat dry)\n    1 1/2 tsp of salt (apply onto both sides)\n    1 tsp of black pepper (\n        apply onto both sides,\n        rub in\n    )\n\ncook seasoned steak with 1 lb of New York strip steak\n```\n\n### Output\n\n```text\n--------------------Cooking seasoned steak with scale 0.500 --------------------\nRecipe for seasoned steak:\n    Summary of ingredients:\n        1.000 lb of New York strip steak\n        0.500 tsp of black pepper\n        0.750 tsp of salt\n    Instructions:\n        1.000 lb of New York strip steak (pat dry)\n        0.750 tsp of salt (apply onto both sides)\n        0.500 tsp of black pepper (\n        apply onto both sides,\n        rub in\n    )\n--------------------------------------------------------------------------------\n```\n\n## Components of ChefScript\n\n### Number\n\nA `number` in ChefScript is a list of whitespace-separated floats or quotients (fraction of two floats). Its value is the sum of all floats and quotients in the list.\n\n```text\n1/2 (this is 0.500)\n1 1/2 (this is 1.500)\n1.3e2 15 .5e1 (this is 150.000)\n```\n\nThe purpose of this design is to make it possible to write `1 1/2` like a recipe book will do, instead of `1.5` which is less commonly used.\n\n### Quantity\n\nA `quantity` is a `number` followed by a `unit`. It is recommended to write a `unit` case-insensitively (`mL` is different from `ML`, but `mL` is the same as `ml`), and using spaces to separate words (`fl oz` or `fl. oz.` looks better than `fl_oz`). It is recommended but not mandatory to put a space between the `number` and the `unit`.\n\n```text\n1 cup\n1 1/2 cups\n50 fl oz\n```\n\n### Ingredient\n\nAn `ingredient` is a `quantity` followed by the keyword `of` and a `name`. It is recommended to write a `name` using spaces to separate words (`chicken breast` looks better than `chicken_breast`), but sometimes an underscore as to be used when a word is in conflict with a keyword.\n\n```text\n1 lb of chicken breast\n```\n\n### Recipe\n\nA `recipe` is a `name` followed by a list of `ingredient`s or other `recipe`s, and optionally together with a list of `instruction`s. The `name` follows the same rules as an `ingredient`'s `name`. The `instruction` is a comment that starts on the same line as an `ingredient` or a `recipe` inside the `recipe`.\n\n```text\nseasoned steak\n    2 lb of New York strip steak (pat dry)\n    (\n        you can put a comment here as well,\n        but it won't be recognised as an instruction.\n    )\n    1 1/2 tsp of salt (apply onto both sides)\n    1 tsp of black pepper (\n        apply onto both sides,\n        rub in\n    )\n```\n\nWhen an `ingredient` is mentioned more than once in a `recipe`, it will be considered a new one each time, and the quantities will be added together. When a `recipe` is mentioned more than once in a `recipe`, it will be considered the same reused, and the quantities will not be added together.\n\n### Comment\n\nA `comment` starts with `(` and ends with `)`. It can be placed at the end of any line, and can run for multiple lines. When put at the end of a line with an `ingredient` or a `recipe`, it will be recognised as an `instruction`.\n\n```text\n(\n    this is a comment\n    that runs for multiple lines\n)\n```\n\n### Function\n\nCurrently, there is only one built-in function in ChefScript, which is `cook`. It takes a `recipe` and an optional `scale` as arguments, and prints out the recipe with the scale applied to all quantities. The `scale` can be a `number` or an `ingredient`, recognised by different keywords used with `cook`.\n\n```text\ncook seasoned steak\ncook seasoned steak for 2 times\ncook seasoned steak with 1 lb of New York strip steak\n```\n\n### Keywords and delimiters\n\nThe keywords are\n\n```text\nof\ncook\nfor\ntimes\nwith\n```\n\nThe delimiters are\n\n```text\n(\n)\n```\n\nThese should be avoided in `name`s.\n",
    "bugtrack_url": null,
    "license": "# Copyright 2022 Yuanhao Chen  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "An esolang for storing, creating and using recipes",
    "version": "0.1.1",
    "split_keywords": [
        "chefscript",
        "recipe",
        "cooking",
        "esolang",
        "esoteric"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "323aba03115333cdf0a292d61621b7a1",
                "sha256": "dd99e5cbc509552ff35ed7428921b2e1bfa7e73f630329c175c3a10b7e6ae6fd"
            },
            "downloads": -1,
            "filename": "ChefScript-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "323aba03115333cdf0a292d61621b7a1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 12580,
            "upload_time": "2022-12-13T12:35:32",
            "upload_time_iso_8601": "2022-12-13T12:35:32.848754Z",
            "url": "https://files.pythonhosted.org/packages/bc/ed/44cb48d9fdf47316c73da28bbea6c92130f05d1240174b6e64ac9cf0be24/ChefScript-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "748c4dcdd781861909adb6ef524283ac",
                "sha256": "b7818781a1104918ce3792bfe66f2852a1b19acb6f0b0cb7cfd75ba77c3e0d86"
            },
            "downloads": -1,
            "filename": "ChefScript-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "748c4dcdd781861909adb6ef524283ac",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 14645,
            "upload_time": "2022-12-13T12:35:34",
            "upload_time_iso_8601": "2022-12-13T12:35:34.372505Z",
            "url": "https://files.pythonhosted.org/packages/d3/d7/5b9b4b995a25d362b73d777624c8e379695c87b715a1250cb4ba623b3cba/ChefScript-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-13 12:35:34",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "chefscript"
}
        
Elapsed time: 0.02863s