{"id":22547905,"url":"https://github.com/bmingles/deephaven_plugin_github","last_synced_at":"2025-03-28T09:12:24.570Z","repository":{"id":251251642,"uuid":"836842026","full_name":"bmingles/deephaven_plugin_github","owner":"bmingles","description":"Deephaven Plugin using Github APIs","archived":false,"fork":false,"pushed_at":"2024-08-02T15:38:22.000Z","size":212,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T09:42:38.069Z","etag":null,"topics":["deephaven-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmingles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-01T17:08:43.000Z","updated_at":"2024-08-06T18:50:34.000Z","dependencies_parsed_at":"2024-08-01T20:09:52.497Z","dependency_job_id":null,"html_url":"https://github.com/bmingles/deephaven_plugin_github","commit_stats":null,"previous_names":["bmingles/deephaven_plugin_github"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmingles%2Fdeephaven_plugin_github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmingles%2Fdeephaven_plugin_github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmingles%2Fdeephaven_plugin_github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmingles%2Fdeephaven_plugin_github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmingles","download_url":"https://codeload.github.com/bmingles/deephaven_plugin_github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245999603,"owners_count":20707570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deephaven-plugin"],"created_at":"2024-12-07T15:13:30.797Z","updated_at":"2025-03-28T09:12:24.556Z","avatar_url":"https://github.com/bmingles.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deephaven_plugin_github\n\nThis is a Python plugin for Deephaven generated from a [deephaven-plugin](https://github.com/deephaven/deephaven-plugins) template.\n\nSpecifically, this plugin is a bidirectional widget plugin, which can send and receive messages on both the client and server.\nThe plugin works out of the box, demonstrates basic plugin structure, and can be used as a starting point for building more complex plugins.\n\n## Plugin Structure\n\nThe `src` directory contains the Python and JavaScript code for the plugin.\nWithin the `src` directory, the deephaven_plugin_github directory contains the Python code, and the `js` directory contains the JavaScript code.\n\nThe Python files have the following structure:\n`deephaven_plugin_github_object.py` defines a simple Python class that can send messages to the client.\n`deephaven_plugin_github_type.py` defines the Python type for the plugin (which is used for registration) and a simple message stream.\n`js_plugin.py` defines the Python class that will be used to setup the JavaScript side of the plugin.\n`register.py` registers the plugin with Deephaven.\n\nThe JavaScript files have the following structure:\n`DeephavenPluginGithubPlugin.ts` registers the plugin with Deephaven.\n`DeephavenPluginGithubView.tsx` defines the plugin panel and message handling.\n\nAdditionally, the `test` directory contains Python tests for the plugin. This demonstrates how the embedded Deephaven server can be used in tests.\nIt's recommended to use `tox` to run the tests, and the `tox.ini` file is included in the project.\n\n## Building the Plugin\n\nTo build the plugin, you will need `npm` and `python` installed, as well as the `build` package for Python.\n`nvm` is also strongly recommended, and an `.nvmrc` file is included in the project.\nThe python venv can be created and the recommended packages installed with the following commands:\n```sh\ncd deephaven_plugin_github\npython -m venv .venv\nsource .venv/bin/activate\npip install --upgrade -r requirements.txt\n```\n\nBuild the JavaScript plugin from the `src/js` directory:\n\n```sh\ncd src/js\nnvm install\nnpm install\nnpm run build\n```\n\nThen, build the Python plugin from the top-level directory:\n\n```sh\ncd ../..\npython -m build --wheel\n```\n\nThe built wheel file will be located in the `dist` directory.\n\nIf you modify the JavaScript code, remove the `build` and `dist` directories before rebuilding the wheel:\n```sh\nrm -rf build dist\n```\n\n## Installing the Plugin\n\nThe plugin can be installed into a Deephaven instance with `pip install \u003cwheel file\u003e`.\nThe wheel file is stored in the `dist` directory after building the plugin.\nExactly how this is done will depend on how you are running Deephaven.\nIf using the venv created above, the plugin and server can be created with the following commands:\n```sh\npip install deephaven-server\npip install dist/deephaven_plugin_github-0.0.1.dev0-py3-none-any.whl\ndeephaven server\n```\nSee the [plug-in documentation](https://deephaven.io/core/docs/how-to-guides/use-plugins/) for more information.\n\n## Using the Plugin\n\nOnce the Deephaven server is running, the plugin should be available to use.\n\n```python\nfrom deephaven_plugin_github import DeephavenPluginGithubObject\n\nobj = DeephavenPluginGithubObject()\n```\n\nA panel should appear. You can now use the object to send messages to the client.\n\n```python\nobj.send_message(\"Hello, world!\")\n```\n\nThe panel can also send messages back to the Python client by using the input field.\n\n## Distributing the Plugin\nTo distribute the plugin, you can upload the wheel file to a package repository, such as [PyPI](https://pypi.org/).\nThe version of the plugin can be updated in the `setup.cfg` file.\n\nThere is a separate instance of PyPI for testing purposes.\nStart by creating an account at [TestPyPI](https://test.pypi.org/account/register/).\nThen, get an API token from [account management](https://test.pypi.org/manage/account/#api-tokens), setting the “Scope” to “Entire account”.\n\nTo upload to the test instance, use the following commands:\n```sh\npython -m pip install --upgrade twine\npython -m twine upload --repository testpypi dist/*\n```\n\nNow, you can install the plugin from the test instance. The extra index is needed to find dependencies:\n```sh\npip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ deephaven_plugin_github\n```\n\nFor a production release, create an account at [PyPI](https://pypi.org/account/register/).\nThen, get an API token from [account management](https://pypi.org/manage/account/#api-tokens), setting the “Scope” to “Entire account”.\n\nTo upload to the production instance, use the following commands. \nNote that `--repository` is the production instance by default, so it can be omitted:\n```sh\npython -m pip install --upgrade twine\npython -m twine upload dist/*\n```\n\nNow, you can install the plugin from the production instance:\n```sh\npip install deephaven_plugin_github\n```\n\nSee the [Python packaging documentation](https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmingles%2Fdeephaven_plugin_github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmingles%2Fdeephaven_plugin_github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmingles%2Fdeephaven_plugin_github/lists"}