# Plover Local Env Var
[![Build Status][Build Status image]][Build Status url] [![PyPI - Version][PyPI version image]][PyPI url] [![PyPI - Downloads][PyPI downloads image]][PyPI url] [![linting: pylint][linting image]][linting url]
This [Plover][] [extension][] [plugin][] contains a [meta][] that can read in
and output values stored in local [environment variables][] on your computer.
## Use Case
Ever have information that is not quite secret enough to warrant putting in a
password manager, but not public enough that you want to have steno dictionary
outlines containing it available to the public? Information like your phone
number, home address, and date of birth is very handy to have in outline values
when filling in online forms etc, but I wouldn't want to share that info in
[my steno dictionaries][].
So, in order to be able to share the outlines I use, but not the values
contained in them, I put that kind of semi-secret information in environment
variables, and use this plugin to access them in order to write them out.
> [!NOTE]
> If you prefer to manually write out all your semi-secret information and/or
> you do not share your steno dictionaries publicly, you may not need to use
> this plugin at all.
> [!WARNING]
> Please do not put secret information like passwords in your steno dictionary
> outlines! Plover stands between when you write your keystrokes and when they
> output on screen, fitting the very definition of a ["man-in-the-middle"][]
> (see your `strokes.log` file for what Plover records by default). Use a
> password manager. If you use [1Password][], you may find the [Plover
> 1Password][] plugin of use to safely retrieve your passwords from your steno
> dictionary outlines.
## Install
1. In the Plover application, open the Plugins Manager (either click the Plugins
Manager icon, or from the `Tools` menu, select `Plugins Manager`).
2. From the list of plugins, find `plover-local-env-var`
3. Click "Install/Update"
4. When it finishes installing, restart Plover
5. After re-opening Plover, open the Configuration screen (either click the
Configuration icon, or from the main Plover application menu, select
`Preferences...`)
6. Open the Plugins tab
7. Check the box next to `plover_local_env_var` to activate the plugin
## How To Use
After defining and [exporting][] environment variables in your [shell
configuration file][], you can use them in your outlines with the `ENV_VAR`
meta. For an environment variable named `$PHONE_NUMBER`, the outline would look
like:
**macOS or Linux**
```json
"{:ENV_VAR:$PHONE_NUMBER}"
```
**Windows**
```json
"{:ENV_VAR:$ENV:PHONE_NUMBER}"
```
Pressing the "Disconnect and reconnect the machine" button on the Plover UI
resets the environment variable cache. If you make any changes to the values
contained in your environment variables, make sure to press it so they get
re-read in again.
All the fetched values also get cached, so subsequent calls to the same env var
get returned quicker.
## Development
Clone from GitHub with [git][]:
```console
git clone git@github.com:paulfioravanti/plover-local-env-var.git
cd plover-local-env-var
python -m pip install --editable ".[test]"
```
If you are a [Tmuxinator][] user, you may find my [plover_local_env_var project
file][] of reference.
### Python Version
Plover's Python environment currently uses version 3.9 (see Plover's
[`workflow_context.yml`][] to confirm the current version).
So, in order to avoid unexpected issues, use your runtime version manager to
make sure your local development environment also uses Python 3.9.x.
### Testing
- [Pytest][] is used for testing in this plugin.
- [Coverage.py][] and [pytest-cov][] are used for test coverage, and to run
coverage within Pytest
- [Pylint][] is used for code quality
- [Mypy][] is used for static type checking
Currently, the only parts able to be tested are ones that do not rely directly
on Plover.
Run tests, coverage, and linting with the following commands:
```console
pytest --cov --cov-report=term-missing
pylint plover_local_env_var
mypy plover_local_env_var
```
To get a HTML test coverage report:
```console
coverage run --module pytest
coverage html
open htmlcov/index.html
```
If you are a [`just`][] user, you may find the [`justfile`][] useful during
development in running multiple test commands. You can run the following command
from the project root directory:
```console
just --working-directory . --justfile test/justfile
```
### Deploying Changes
After making any code changes, deploy the plugin into Plover with the following
command:
```console
plover --script plover_plugins install --editable .
```
> Where `plover` in the command is a reference to your locally installed version
> of Plover. See the [Invoke Plover from the command line][] page for details on
> how to create that reference.
When necessary, the plugin can be uninstalled via the command line with the
following command:
```console
plover --script plover_plugins uninstall plover-local-env-var
```
[1Password]: https://1password.com/
[Build Status image]: https://github.com/paulfioravanti/plover-local-env-var/actions/workflows/ci.yml/badge.svg
[Build Status url]: https://github.com/paulfioravanti/plover-local-env-var/actions/workflows/ci.yml
[Coverage.py]: https://github.com/nedbat/coveragepy
[environment variables]: https://en.wikipedia.org/wiki/Environment_variable
[exporting]: https://en.wikipedia.org/wiki/Environment_variable#Assignment:_Unix
[extension]: https://plover.readthedocs.io/en/latest/plugin-dev/extensions.html
[git]: https://git-scm.com/
[Invoke Plover from the command line]: https://github.com/openstenoproject/plover/wiki/Invoke-Plover-from-the-command-line
[`just`]: https://github.com/casey/just
[`justfile`]: ./test/justfile
[linting image]: https://img.shields.io/badge/linting-pylint-yellowgreen
[linting url]: https://github.com/pylint-dev/pylint
["man-in-the-middle"]: https://en.wikipedia.org/wiki/Man-in-the-middle_attack
[meta]: https://plover.readthedocs.io/en/latest/plugin-dev/metas.html
[my steno dictionaries]: https://github.com/paulfioravanti/steno-dictionaries
[Mypy]: https://github.com/python/mypy
[Plover]: https://www.openstenoproject.org/
[Plover 1Password]: https://github.com/paulfioravanti/plover-1password
[plover_local_env_var project file]: https://github.com/paulfioravanti/dotfiles/blob/master/tmuxinator/plover_local_env_var.yml
[plugin]: https://plover.readthedocs.io/en/latest/plugins.html#types-of-plugins
[Pylint]: https://github.com/pylint-dev/pylint
[PyPI downloads image]:https://img.shields.io/pypi/dm/plover-local-env-var
[PyPI version image]: https://img.shields.io/pypi/v/plover-local-env-var
[PyPI url]: https://pypi.org/project/plover-local-env-var/
[Pytest]: https://pytest.org/
[pytest-cov]: https://github.com/pytest-dev/pytest-cov/
[shell configuration file]: https://en.wikipedia.org/wiki/Unix_shell#Configuration_files
[Tmuxinator]: https://github.com/tmuxinator/tmuxinator
[`workflow_context.yml`]: https://github.com/openstenoproject/plover/blob/master/.github/workflows/ci/workflow_context.yml
Raw data
{
"_id": null,
"home_page": "https://github.com/paulfioravanti/plover-local-env-var",
"name": "plover-local-env-var",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "plover plover_plugin",
"author": "Paul Fioravanti",
"author_email": "paul@paulfioravanti.com",
"download_url": "https://files.pythonhosted.org/packages/cd/66/7596374b0bde577eb6c2aec4838bb43486cbf654016e59ff7c8abd3e2dda/plover_local_env_var-0.3.9.tar.gz",
"platform": null,
"description": "# Plover Local Env Var\n\n[![Build Status][Build Status image]][Build Status url] [![PyPI - Version][PyPI version image]][PyPI url] [![PyPI - Downloads][PyPI downloads image]][PyPI url] [![linting: pylint][linting image]][linting url]\n\nThis [Plover][] [extension][] [plugin][] contains a [meta][] that can read in\nand output values stored in local [environment variables][] on your computer.\n\n## Use Case\n\nEver have information that is not quite secret enough to warrant putting in a\npassword manager, but not public enough that you want to have steno dictionary\noutlines containing it available to the public? Information like your phone\nnumber, home address, and date of birth is very handy to have in outline values\nwhen filling in online forms etc, but I wouldn't want to share that info in\n[my steno dictionaries][].\n\nSo, in order to be able to share the outlines I use, but not the values\ncontained in them, I put that kind of semi-secret information in environment\nvariables, and use this plugin to access them in order to write them out.\n\n> [!NOTE]\n> If you prefer to manually write out all your semi-secret information and/or\n> you do not share your steno dictionaries publicly, you may not need to use\n> this plugin at all.\n\n> [!WARNING]\n> Please do not put secret information like passwords in your steno dictionary\n> outlines! Plover stands between when you write your keystrokes and when they\n> output on screen, fitting the very definition of a [\"man-in-the-middle\"][]\n> (see your `strokes.log` file for what Plover records by default). Use a\n> password manager. If you use [1Password][], you may find the [Plover\n> 1Password][] plugin of use to safely retrieve your passwords from your steno\n> dictionary outlines.\n\n## Install\n\n1. In the Plover application, open the Plugins Manager (either click the Plugins\n Manager icon, or from the `Tools` menu, select `Plugins Manager`).\n2. From the list of plugins, find `plover-local-env-var`\n3. Click \"Install/Update\"\n4. When it finishes installing, restart Plover\n5. After re-opening Plover, open the Configuration screen (either click the\n Configuration icon, or from the main Plover application menu, select\n `Preferences...`)\n6. Open the Plugins tab\n7. Check the box next to `plover_local_env_var` to activate the plugin\n\n## How To Use\n\nAfter defining and [exporting][] environment variables in your [shell\nconfiguration file][], you can use them in your outlines with the `ENV_VAR`\nmeta. For an environment variable named `$PHONE_NUMBER`, the outline would look\nlike:\n\n**macOS or Linux**\n\n```json\n\"{:ENV_VAR:$PHONE_NUMBER}\"\n```\n\n**Windows**\n\n```json\n\"{:ENV_VAR:$ENV:PHONE_NUMBER}\"\n```\n\nPressing the \"Disconnect and reconnect the machine\" button on the Plover UI\nresets the environment variable cache. If you make any changes to the values\ncontained in your environment variables, make sure to press it so they get\nre-read in again.\n\nAll the fetched values also get cached, so subsequent calls to the same env var\nget returned quicker.\n\n## Development\n\nClone from GitHub with [git][]:\n\n```console\ngit clone git@github.com:paulfioravanti/plover-local-env-var.git\ncd plover-local-env-var\npython -m pip install --editable \".[test]\"\n```\n\nIf you are a [Tmuxinator][] user, you may find my [plover_local_env_var project\nfile][] of reference.\n\n### Python Version\n\nPlover's Python environment currently uses version 3.9 (see Plover's\n[`workflow_context.yml`][] to confirm the current version).\n\nSo, in order to avoid unexpected issues, use your runtime version manager to\nmake sure your local development environment also uses Python 3.9.x.\n\n### Testing\n\n- [Pytest][] is used for testing in this plugin.\n- [Coverage.py][] and [pytest-cov][] are used for test coverage, and to run\n coverage within Pytest\n- [Pylint][] is used for code quality\n- [Mypy][] is used for static type checking\n\nCurrently, the only parts able to be tested are ones that do not rely directly\non Plover.\n\nRun tests, coverage, and linting with the following commands:\n\n```console\npytest --cov --cov-report=term-missing\npylint plover_local_env_var\nmypy plover_local_env_var\n```\n\nTo get a HTML test coverage report:\n\n```console\ncoverage run --module pytest\ncoverage html\nopen htmlcov/index.html\n```\n\nIf you are a [`just`][] user, you may find the [`justfile`][] useful during\ndevelopment in running multiple test commands. You can run the following command\nfrom the project root directory:\n\n```console\njust --working-directory . --justfile test/justfile\n```\n\n### Deploying Changes\n\nAfter making any code changes, deploy the plugin into Plover with the following\ncommand:\n\n```console\nplover --script plover_plugins install --editable .\n```\n\n> Where `plover` in the command is a reference to your locally installed version\n> of Plover. See the [Invoke Plover from the command line][] page for details on\n> how to create that reference.\n\nWhen necessary, the plugin can be uninstalled via the command line with the\nfollowing command:\n\n```console\nplover --script plover_plugins uninstall plover-local-env-var\n```\n\n[1Password]: https://1password.com/\n[Build Status image]: https://github.com/paulfioravanti/plover-local-env-var/actions/workflows/ci.yml/badge.svg\n[Build Status url]: https://github.com/paulfioravanti/plover-local-env-var/actions/workflows/ci.yml\n[Coverage.py]: https://github.com/nedbat/coveragepy\n[environment variables]: https://en.wikipedia.org/wiki/Environment_variable\n[exporting]: https://en.wikipedia.org/wiki/Environment_variable#Assignment:_Unix\n[extension]: https://plover.readthedocs.io/en/latest/plugin-dev/extensions.html\n[git]: https://git-scm.com/\n[Invoke Plover from the command line]: https://github.com/openstenoproject/plover/wiki/Invoke-Plover-from-the-command-line\n[`just`]: https://github.com/casey/just\n[`justfile`]: ./test/justfile\n[linting image]: https://img.shields.io/badge/linting-pylint-yellowgreen\n[linting url]: https://github.com/pylint-dev/pylint\n[\"man-in-the-middle\"]: https://en.wikipedia.org/wiki/Man-in-the-middle_attack\n[meta]: https://plover.readthedocs.io/en/latest/plugin-dev/metas.html\n[my steno dictionaries]: https://github.com/paulfioravanti/steno-dictionaries\n[Mypy]: https://github.com/python/mypy\n[Plover]: https://www.openstenoproject.org/\n[Plover 1Password]: https://github.com/paulfioravanti/plover-1password\n[plover_local_env_var project file]: https://github.com/paulfioravanti/dotfiles/blob/master/tmuxinator/plover_local_env_var.yml\n[plugin]: https://plover.readthedocs.io/en/latest/plugins.html#types-of-plugins\n[Pylint]: https://github.com/pylint-dev/pylint\n[PyPI downloads image]:https://img.shields.io/pypi/dm/plover-local-env-var\n[PyPI version image]: https://img.shields.io/pypi/v/plover-local-env-var\n[PyPI url]: https://pypi.org/project/plover-local-env-var/\n[Pytest]: https://pytest.org/\n[pytest-cov]: https://github.com/pytest-dev/pytest-cov/\n[shell configuration file]: https://en.wikipedia.org/wiki/Unix_shell#Configuration_files\n[Tmuxinator]: https://github.com/tmuxinator/tmuxinator\n[`workflow_context.yml`]: https://github.com/openstenoproject/plover/blob/master/.github/workflows/ci/workflow_context.yml\n",
"bugtrack_url": null,
"license": "GNU General Public License v3 or later (GPLv3+)",
"summary": "Use your local environment variables in Plover",
"version": "0.3.9",
"project_urls": {
"Homepage": "https://github.com/paulfioravanti/plover-local-env-var"
},
"split_keywords": [
"plover",
"plover_plugin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "812af80796e559ec6215a3375a5ed1dc114c16686171eea2cd20ac6ad0c57e75",
"md5": "7fe9daabb363e2c24ae584ca9d38922d",
"sha256": "f37a97f7c3a5b2e4bd86bf09be36214b497251fc52b66d71272d7479e46b4a83"
},
"downloads": -1,
"filename": "plover_local_env_var-0.3.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7fe9daabb363e2c24ae584ca9d38922d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 22583,
"upload_time": "2024-10-10T07:17:55",
"upload_time_iso_8601": "2024-10-10T07:17:55.351857Z",
"url": "https://files.pythonhosted.org/packages/81/2a/f80796e559ec6215a3375a5ed1dc114c16686171eea2cd20ac6ad0c57e75/plover_local_env_var-0.3.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cd667596374b0bde577eb6c2aec4838bb43486cbf654016e59ff7c8abd3e2dda",
"md5": "6cb171a12ce9e0d2b46c7076f9f2bace",
"sha256": "310391931a135e0ecb5b995a3909d58e54aa9a041183e759f111779793980b5a"
},
"downloads": -1,
"filename": "plover_local_env_var-0.3.9.tar.gz",
"has_sig": false,
"md5_digest": "6cb171a12ce9e0d2b46c7076f9f2bace",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22746,
"upload_time": "2024-10-10T07:17:56",
"upload_time_iso_8601": "2024-10-10T07:17:56.949915Z",
"url": "https://files.pythonhosted.org/packages/cd/66/7596374b0bde577eb6c2aec4838bb43486cbf654016e59ff7c8abd3e2dda/plover_local_env_var-0.3.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-10 07:17:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "paulfioravanti",
"github_project": "plover-local-env-var",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "plover-local-env-var"
}