plover-engine-server-2


Nameplover-engine-server-2 JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/user202729/plover_websocket_server
SummaryA server for exposing Plover engine events and functionality
upload_time2024-03-06 21:37:13
maintainer
docs_urlNone
authorNick Markopoulos
requires_python
licenseGNU General Public License v3 or later (GPLv3+)
keywords plover plover_plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Plover WebSocket Server

[![PyPI](https://img.shields.io/pypi/v/plover-engine-server-2?style=flat)](https://pypi.python.org/pypi/plover-engine-server-2/)

A WebSocket server for exposing [Plover](https://github.com/openstenoproject/plover) events
and controlling Plover from an external program.

This plugin is available on [GitHub]( https://github.com/user202729/plover_websocket_server)
and [PyPI](https://pypi.org/project/plover-engine-server-2/) (under the name `plover-engine-server-2`).
Report all bugs on GitHub.

## Installation

Download the latest version of Plover for your operating system from the [releases page](https://github.com/openstenoproject/plover/releases). Only versions 4.0.0.dev8 and higher are supported.

1. Open Plover
2. Navigate to the Plugin Manager tool
3. Select the "plover-engine-server-2" plugin entry in the list
4. Click install
5. Restart Plover

The same method can be used for updating and uninstalling the plugin.

## Configuration

To configure the plugin, create a file named `plover_engine_server_config.json`
inside Plover's configuration directory (same directory as `plover.cfg` file).

Example content:

```json
{
  "host": "localhost",
  "port": 8086,
  "secretkey": "mysecretkey",
  "ssl": {
    "cert_path": "/path/to/cert.pem",
    "key_path": "/path/to/key.pem"
  }
}
```

All fields are optional, except if you have either specified a `cert_path` or a `key_path`. In that case you have to make sure that the path pair is properly set there. The default is included in the example above.

## How to Use

* Enable it in Configure -> Plugins
* Connect to either ws://localhost:8086/websocket or wss://localhost:8086/websocket, depending on whether or not you have specified SSL configuration, with your client and get the data pushed to you as
event: data formatted JSON.

### Received data format

Search for occurrences of `queue_message` in `plover_engine_server/manager.py`,
or write an example program (or use the existing `plover_engine_server/websocket/example_client.py`)
and observe its output.

Controlling Plover from other programs:

* Sending 'close' disconnects you.
* Sending a valid JSON string will execute the specified action.
For example `{"stroke": ["S-"]}` (note that invalid keys are silently dropped),
or `{"translation": "abc"}`.

Note: to avoid Plover being controlled by a malicious website, you should set some other than default key, and
add the secret key to the request header `X-Secret-Token`.

If there's some error during the execution, it will be silently ignored and printed on stderr.

If the `"force"` key is `true` then the command will be executed even when the engine is turned off.
Note that `{PLOVER:RESUME}` will have no effect in that case.

Because the Plover inner working is closely tied to the assumption
that strokes can only come from the keyboard, when `{PLOVER:RESUME}` (or a command with similar effect,
such as `{PLOVER:TOGGLE}`) is sent and the machine is
"Keyboard" then some characters before the cursor will be deleted.
To prevent this, set the `"zero_last_stroke_length"` key to `true`.
**Note** This should be used very sparingly because it may have unintended effects.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/user202729/plover_websocket_server",
    "name": "plover-engine-server-2",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "plover plover_plugin",
    "author": "Nick Markopoulos",
    "author_email": "nsmarkop@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "# Plover WebSocket Server\n\n[![PyPI](https://img.shields.io/pypi/v/plover-engine-server-2?style=flat)](https://pypi.python.org/pypi/plover-engine-server-2/)\n\nA WebSocket server for exposing [Plover](https://github.com/openstenoproject/plover) events\nand controlling Plover from an external program.\n\nThis plugin is available on [GitHub]( https://github.com/user202729/plover_websocket_server)\nand [PyPI](https://pypi.org/project/plover-engine-server-2/) (under the name `plover-engine-server-2`).\nReport all bugs on GitHub.\n\n## Installation\n\nDownload the latest version of Plover for your operating system from the [releases page](https://github.com/openstenoproject/plover/releases). Only versions 4.0.0.dev8 and higher are supported.\n\n1. Open Plover\n2. Navigate to the Plugin Manager tool\n3. Select the \"plover-engine-server-2\" plugin entry in the list\n4. Click install\n5. Restart Plover\n\nThe same method can be used for updating and uninstalling the plugin.\n\n## Configuration\n\nTo configure the plugin, create a file named `plover_engine_server_config.json`\ninside Plover's configuration directory (same directory as `plover.cfg` file).\n\nExample content:\n\n```json\n{\n  \"host\": \"localhost\",\n  \"port\": 8086,\n  \"secretkey\": \"mysecretkey\",\n  \"ssl\": {\n    \"cert_path\": \"/path/to/cert.pem\",\n    \"key_path\": \"/path/to/key.pem\"\n  }\n}\n```\n\nAll fields are optional, except if you have either specified a `cert_path` or a `key_path`. In that case you have to make sure that the path pair is properly set there. The default is included in the example above.\n\n## How to Use\n\n* Enable it in Configure -> Plugins\n* Connect to either ws://localhost:8086/websocket or wss://localhost:8086/websocket, depending on whether or not you have specified SSL configuration, with your client and get the data pushed to you as\nevent: data formatted JSON.\n\n### Received data format\n\nSearch for occurrences of `queue_message` in `plover_engine_server/manager.py`,\nor write an example program (or use the existing `plover_engine_server/websocket/example_client.py`)\nand observe its output.\n\nControlling Plover from other programs:\n\n* Sending 'close' disconnects you.\n* Sending a valid JSON string will execute the specified action.\nFor example `{\"stroke\": [\"S-\"]}` (note that invalid keys are silently dropped),\nor `{\"translation\": \"abc\"}`.\n\nNote: to avoid Plover being controlled by a malicious website, you should set some other than default key, and\nadd the secret key to the request header `X-Secret-Token`.\n\nIf there's some error during the execution, it will be silently ignored and printed on stderr.\n\nIf the `\"force\"` key is `true` then the command will be executed even when the engine is turned off.\nNote that `{PLOVER:RESUME}` will have no effect in that case.\n\nBecause the Plover inner working is closely tied to the assumption\nthat strokes can only come from the keyboard, when `{PLOVER:RESUME}` (or a command with similar effect,\nsuch as `{PLOVER:TOGGLE}`) is sent and the machine is\n\"Keyboard\" then some characters before the cursor will be deleted.\nTo prevent this, set the `\"zero_last_stroke_length\"` key to `true`.\n**Note** This should be used very sparingly because it may have unintended effects.\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 or later (GPLv3+)",
    "summary": "A server for exposing Plover engine events and functionality",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/user202729/plover_websocket_server"
    },
    "split_keywords": [
        "plover",
        "plover_plugin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5d610b52fb8e1a76d84381061e0635ed13e2ff72a97141626c9279adb448b887",
                "md5": "45dee38c05b460db12b9cb86861f9d0c",
                "sha256": "0d44842e98ece72f12751c8cb3b72923429953d2a70a539feb3f241a126c1257"
            },
            "downloads": -1,
            "filename": "plover_engine_server_2-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "45dee38c05b460db12b9cb86861f9d0c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 26146,
            "upload_time": "2024-03-06T21:37:13",
            "upload_time_iso_8601": "2024-03-06T21:37:13.235968Z",
            "url": "https://files.pythonhosted.org/packages/5d/61/0b52fb8e1a76d84381061e0635ed13e2ff72a97141626c9279adb448b887/plover_engine_server_2-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-06 21:37:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "user202729",
    "github_project": "plover_websocket_server",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "plover-engine-server-2"
}
        
Elapsed time: 0.20190s