ovos-eggscript


Nameovos-eggscript JSON
Version 0.0.0 PyPI version JSON
download
home_pagehttps://github.com/OpenVoiceOS/eggscript
Summary
upload_time2024-02-21 00:17:55
maintainer
docs_urlNone
authorjarbasai
requires_python
licenseMIT
keywords ovos skill builder
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Eggscript

Eggscript is a markup language that can be "compiled" into a valid OVOS Skill

> **EXPERIMENTAL** This is an experimental feature

It is intended as an easy way for user to create simple skills, while offering an easy transition to regular skills

It also helps getting a lot of the boilerplate done for you when getting started

## Crash Course

Example files written in eggscript


hello.eggscript

        // this is a comment
        // all comments and blank lines are ignored
        // special interperter variables can be set with @var syntax
        // - @name -> skill name
        // - @author -> skill author
        // - @email -> author contact
        // - @license -> skill license
        // - @interpreter -> supported interperter, eg, cli
        // - @compiler -> supported compiler, eg, mycroft skill

        @author jarbasai
        @email jarbasai@mailfence.com
        @license MIT
        @name hello world
        @url https://github.com/author/repo
        @version 0.1.0

        // this script can be used standalone in the cli
        @interpreter cli
        // a standalone python file can be generated
        @compiler cli
        // a mycroft skill can be generated
        @compiler mycroft

        // intent definition
        # hello world
        + hello world
        - hello world

        // you can define python code
        ```
        hello = "world"
        if hello == "world":
        print("python code!")
        ```


dialogs.eggscript


        // this is a comment
        // all comments and blank lines are ignored

        // text after # is the intent name
        # hello world
        // text after + is the user utterance
        + hello world
        // text after - is mycroft's response
          - hello world


        # weather in location
        // you can capture variables and use them using {var} syntax
        + how is the weather in {location}
          - how am i supposed to know the weather in {location}


        # weather
        // this will create a intent file with the 3 + utterances
        + what is the weather like
          + how is the weather
          + how does it look outside
          // this will create a dialog file with the 2 - utterances
          - i do not know how to check the weather
          - stick your head ouf of the window and check for yourself


        # count to 10
        + count to 10
        // if ident level matches its an alternate dialog
          - i will only count to 5
          - i only know how to count to 5
          // use tab for identation
          // each ident level defines a new utterance to be spoken
              - 1
                  - 2
                      - 3
                          - 4
                              - 5



layers.eggscript


        // this is a comment
        // all comments and blank lines are ignored
        // this sample scripts show intent layers usage


        // the number of # in intent definition determines an intent layer
        # tell me about
        + tell me about {thing}
          - {thing} exists

        // N times + will enable layer N
        // to enable layer 2
        ++


        // use N times # for layer N
        // this intent is in layer 2, enabled by previous intent
        ## tell me more
        + tell me more
          + continue
          - i do not know more

        // N times - will disable layer N
        // to disable layer 2
        --




## Interpreters

Can run a subset of eggscript directly, enough to test simple skills in the terminal

```python
from eggscript import CliInterpreter
from os.path import dirname

c = CliInterpreter()
c.load_eggscript_file(f"{dirname(__file__)}/dialogs.eggscript")
c.run()

```

## Compilers

```python
from eggscript import OVOSSkillCompiler
from os.path import dirname

c = OVOSSkillCompiler()
c.load_eggscript_file(f"{dirname(__file__)}/layers.eggscript")
c.export("myskill")
```

You can now continue extending your exported skill to add more advanced functionality


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OpenVoiceOS/eggscript",
    "name": "ovos-eggscript",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ovos skill builder",
    "author": "jarbasai",
    "author_email": "jarbasai@mailfence.com",
    "download_url": "",
    "platform": null,
    "description": "# Eggscript\n\nEggscript is a markup language that can be \"compiled\" into a valid OVOS Skill\n\n> **EXPERIMENTAL** This is an experimental feature\n\nIt is intended as an easy way for user to create simple skills, while offering an easy transition to regular skills\n\nIt also helps getting a lot of the boilerplate done for you when getting started\n\n## Crash Course\n\nExample files written in eggscript\n\n\nhello.eggscript\n\n        // this is a comment\n        // all comments and blank lines are ignored\n        // special interperter variables can be set with @var syntax\n        // - @name -> skill name\n        // - @author -> skill author\n        // - @email -> author contact\n        // - @license -> skill license\n        // - @interpreter -> supported interperter, eg, cli\n        // - @compiler -> supported compiler, eg, mycroft skill\n\n        @author jarbasai\n        @email jarbasai@mailfence.com\n        @license MIT\n        @name hello world\n        @url https://github.com/author/repo\n        @version 0.1.0\n\n        // this script can be used standalone in the cli\n        @interpreter cli\n        // a standalone python file can be generated\n        @compiler cli\n        // a mycroft skill can be generated\n        @compiler mycroft\n\n        // intent definition\n        # hello world\n        + hello world\n        - hello world\n\n        // you can define python code\n        ```\n        hello = \"world\"\n        if hello == \"world\":\n        print(\"python code!\")\n        ```\n\n\ndialogs.eggscript\n\n\n        // this is a comment\n        // all comments and blank lines are ignored\n\n        // text after # is the intent name\n        # hello world\n        // text after + is the user utterance\n        + hello world\n        // text after - is mycroft's response\n          - hello world\n\n\n        # weather in location\n        // you can capture variables and use them using {var} syntax\n        + how is the weather in {location}\n          - how am i supposed to know the weather in {location}\n\n\n        # weather\n        // this will create a intent file with the 3 + utterances\n        + what is the weather like\n          + how is the weather\n          + how does it look outside\n          // this will create a dialog file with the 2 - utterances\n          - i do not know how to check the weather\n          - stick your head ouf of the window and check for yourself\n\n\n        # count to 10\n        + count to 10\n        // if ident level matches its an alternate dialog\n          - i will only count to 5\n          - i only know how to count to 5\n          // use tab for identation\n          // each ident level defines a new utterance to be spoken\n              - 1\n                  - 2\n                      - 3\n                          - 4\n                              - 5\n\n\n\nlayers.eggscript\n\n\n        // this is a comment\n        // all comments and blank lines are ignored\n        // this sample scripts show intent layers usage\n\n\n        // the number of # in intent definition determines an intent layer\n        # tell me about\n        + tell me about {thing}\n          - {thing} exists\n\n        // N times + will enable layer N\n        // to enable layer 2\n        ++\n\n\n        // use N times # for layer N\n        // this intent is in layer 2, enabled by previous intent\n        ## tell me more\n        + tell me more\n          + continue\n          - i do not know more\n\n        // N times - will disable layer N\n        // to disable layer 2\n        --\n\n\n\n\n## Interpreters\n\nCan run a subset of eggscript directly, enough to test simple skills in the terminal\n\n```python\nfrom eggscript import CliInterpreter\nfrom os.path import dirname\n\nc = CliInterpreter()\nc.load_eggscript_file(f\"{dirname(__file__)}/dialogs.eggscript\")\nc.run()\n\n```\n\n## Compilers\n\n```python\nfrom eggscript import OVOSSkillCompiler\nfrom os.path import dirname\n\nc = OVOSSkillCompiler()\nc.load_eggscript_file(f\"{dirname(__file__)}/layers.eggscript\")\nc.export(\"myskill\")\n```\n\nYou can now continue extending your exported skill to add more advanced functionality\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "",
    "version": "0.0.0",
    "project_urls": {
        "Homepage": "https://github.com/OpenVoiceOS/eggscript"
    },
    "split_keywords": [
        "ovos",
        "skill",
        "builder"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e1f6005065face9a3a141acdbdf0ab2c72ca79abf72ad74d3aeb7342824b11be",
                "md5": "ce688c44d100799372bbf81ded91cd42",
                "sha256": "cba3b7f2fdbeb1b9b6e93927a8241525b0250c1cce2aa6ea7447d7f5aad1ae90"
            },
            "downloads": -1,
            "filename": "ovos_eggscript-0.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ce688c44d100799372bbf81ded91cd42",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4915,
            "upload_time": "2024-02-21T00:17:55",
            "upload_time_iso_8601": "2024-02-21T00:17:55.598070Z",
            "url": "https://files.pythonhosted.org/packages/e1/f6/005065face9a3a141acdbdf0ab2c72ca79abf72ad74d3aeb7342824b11be/ovos_eggscript-0.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-21 00:17:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OpenVoiceOS",
    "github_project": "eggscript",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ovos-eggscript"
}
        
Elapsed time: 0.25805s