trame-remote-control


Nametrame-remote-control JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA trame extension to allow outside programs to send instructions to a trame app
upload_time2024-07-19 12:54:16
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024, Jonathan Windgassen, Forschungszentrum Jülich e.V. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python interactive web application framework paraview trame
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # trame-remote-control
A trame extension to allow outside programs to send instructions to a trame app.

*trame-remote-control* attaches a REST-API endpoint, which can be used by outside programs to send instrctions, 
called **actions** to the program. This can, e.g., be used to initialite a Connection between a trame app and a ParaView Server.

## Supported Actions
The API endpoint will by default initialized on the `/api` path, which can be changed be setting the `REMOTE_CONTROL_ENDPOINT` 
environment variable to a different location.

To trigger an action, send a POST request to the API path. The body must contain a JSON, which specifies the action to trigger 
and might contain the parameters for that action. See the list below for the supported actions and their required parameters:

```json
{
  "action": "connect",
  "url": "localhost",
  "port": 11111
}
```

| Action Name     | Parameters                              | Description                                                           |
|-----------------|-----------------------------------------|-----------------------------------------------------------------------|
| `connect`       | url: string, port: optional int = 11111 | Connect a trame-vtk app to a ParaView Serverrunning on `<url>:<port>` |
| `diconnect`     |                                         | Disconnect from a previously connected ParaView Server                |
| `open_catalyst` |                                         | Open a Catalyst connection                                            |

## Installing
To install this extension, execute `pip install trame-remote-control`

For a Development install, clone the repository and execute `pip install -e .`


## Usage
After you installed the extension, import the module via trame.
To initialize the API endpoint, execute the `initialize` method. 
If you, optionally, want to create the UI Elements to trigger action from within the application, you can execute `create_panel`:

```python
from trame.app import get_server
from trame.ui.vuetify import SinglePageLayout
from trame.widgets import vuetify, remote_control

def main():
    server = get_server()
    
    ... # Other initialization
    
    remote_control.initialize(server)

    # Create UI
    with SinglePageLayout(server):
        ...

        with vuetify.VCol():
            remote_control.create_panel(server)
```

## ToDos
- Allow developers to specify which Actions are initialized
- Add ping route to retrieve if application has finished loading and which Actions are available
- Create more Actions

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "trame-remote-control",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "Python, Interactive, Web, Application, Framework, ParaView, trame",
    "author": null,
    "author_email": "Jonathan Windgassen <j.windgassen@fz-juelich.de>",
    "download_url": "https://files.pythonhosted.org/packages/3a/80/0b4b904c4cfdf631ccf47a16da44b4800d0eeac52276307cf0805cc03bd9/trame_remote_control-0.1.1.tar.gz",
    "platform": null,
    "description": "# trame-remote-control\nA trame extension to allow outside programs to send instructions to a trame app.\n\n*trame-remote-control* attaches a REST-API endpoint, which can be used by outside programs to send instrctions, \ncalled **actions** to the program. This can, e.g., be used to initialite a Connection between a trame app and a ParaView Server.\n\n## Supported Actions\nThe API endpoint will by default initialized on the `/api` path, which can be changed be setting the `REMOTE_CONTROL_ENDPOINT` \nenvironment variable to a different location.\n\nTo trigger an action, send a POST request to the API path. The body must contain a JSON, which specifies the action to trigger \nand might contain the parameters for that action. See the list below for the supported actions and their required parameters:\n\n```json\n{\n  \"action\": \"connect\",\n  \"url\": \"localhost\",\n  \"port\": 11111\n}\n```\n\n| Action Name     | Parameters                              | Description                                                           |\n|-----------------|-----------------------------------------|-----------------------------------------------------------------------|\n| `connect`       | url: string, port: optional int = 11111 | Connect a trame-vtk app to a ParaView Serverrunning on `<url>:<port>` |\n| `diconnect`     |                                         | Disconnect from a previously connected ParaView Server                |\n| `open_catalyst` |                                         | Open a Catalyst connection                                            |\n\n## Installing\nTo install this extension, execute `pip install trame-remote-control`\n\nFor a Development install, clone the repository and execute `pip install -e .`\n\n\n## Usage\nAfter you installed the extension, import the module via trame.\nTo initialize the API endpoint, execute the `initialize` method. \nIf you, optionally, want to create the UI Elements to trigger action from within the application, you can execute `create_panel`:\n\n```python\nfrom trame.app import get_server\nfrom trame.ui.vuetify import SinglePageLayout\nfrom trame.widgets import vuetify, remote_control\n\ndef main():\n    server = get_server()\n    \n    ... # Other initialization\n    \n    remote_control.initialize(server)\n\n    # Create UI\n    with SinglePageLayout(server):\n        ...\n\n        with vuetify.VCol():\n            remote_control.create_panel(server)\n```\n\n## ToDos\n- Allow developers to specify which Actions are initialized\n- Add ping route to retrieve if application has finished loading and which Actions are available\n- Create more Actions\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024, Jonathan Windgassen, Forschungszentrum J\u00fclich e.V.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A trame extension to allow outside programs to send instructions to a trame app",
    "version": "0.1.1",
    "project_urls": {
        "Issues": "https://github.com/jwindgassen/trame-remote-control/issues",
        "Repository": "https://github.com/jwindgassen/trame-remote-control"
    },
    "split_keywords": [
        "python",
        " interactive",
        " web",
        " application",
        " framework",
        " paraview",
        " trame"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b3895e4a5e9c5f34581edcd766184dd71f024113047e61ecb5a24670ca794a2a",
                "md5": "4f1194c74eafafdfb7d475c2af2ae347",
                "sha256": "b7083a290fcc50aa2d4fdc7de73dcd574e976d6c72f185b199da628339bf209b"
            },
            "downloads": -1,
            "filename": "trame_remote_control-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4f1194c74eafafdfb7d475c2af2ae347",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9360,
            "upload_time": "2024-07-19T12:54:15",
            "upload_time_iso_8601": "2024-07-19T12:54:15.250179Z",
            "url": "https://files.pythonhosted.org/packages/b3/89/5e4a5e9c5f34581edcd766184dd71f024113047e61ecb5a24670ca794a2a/trame_remote_control-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a800b4b904c4cfdf631ccf47a16da44b4800d0eeac52276307cf0805cc03bd9",
                "md5": "d84c5b7ff707d3e4a518ffcdfbeec189",
                "sha256": "1834789ec15ab7964badaa3a13f8dd29c1e96a7f66f5569538d72a30237d96d2"
            },
            "downloads": -1,
            "filename": "trame_remote_control-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d84c5b7ff707d3e4a518ffcdfbeec189",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7956,
            "upload_time": "2024-07-19T12:54:16",
            "upload_time_iso_8601": "2024-07-19T12:54:16.850665Z",
            "url": "https://files.pythonhosted.org/packages/3a/80/0b4b904c4cfdf631ccf47a16da44b4800d0eeac52276307cf0805cc03bd9/trame_remote_control-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-19 12:54:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jwindgassen",
    "github_project": "trame-remote-control",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "trame-remote-control"
}
        
Elapsed time: 0.63747s