datasette-expose-env


Namedatasette-expose-env JSON
Version 0.2 PyPI version JSON
download
home_pagehttps://github.com/simonw/datasette-expose-env
SummaryDatasette plugin to expose selected environment variables at /-/env for debugging
upload_time2024-03-03 00:07:37
maintainer
docs_urlNone
authorSimon Willison
requires_python>=3.8
licenseApache License, Version 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # datasette-expose-env

[![PyPI](https://img.shields.io/pypi/v/datasette-expose-env.svg)](https://pypi.org/project/datasette-expose-env/)
[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-expose-env?include_prereleases&label=changelog)](https://github.com/simonw/datasette-expose-env/releases)
[![Tests](https://github.com/simonw/datasette-expose-env/workflows/Test/badge.svg)](https://github.com/simonw/datasette-expose-env/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-expose-env/blob/main/LICENSE)

Datasette plugin to expose selected environment variables at `/-/env` for debugging

## Installation

Install this plugin in the same environment as Datasette.
```bash
datasette install datasette-expose-env
```
## Configuration

Decide on a list of environment variables you would like to expose, then add the following to your `metadata.yml` configuration:

```yaml
plugins:
  datasette-expose-env:
    variables:
    - ENV_VAR_1
    - ENV_VAR_2
    - ENV_VAR_3
```

If you are using JSON in a `metadata.json` file use the following:

```json
{
  "plugins": {
    "datasette-expose-env": {
      "variables": [
        "ENV_VAR_1",
        "ENV_VAR_2",
        "ENV_VAR_3"
      ]
    }
  }
}
```
To show a full list of redacted environment variables use `"show_all_redacted": true`:

```yaml
plugins:
  datasette-expose-env:
    show_all_redacted: true
    variables:
    - ENV_VAR_1
    - ENV_VAR_2
```
This will show the values for `ENV_VAR_1` and `ENV_VAR_2` and then a full list of other variables with their value shown as `...`.


Visit `/-/env` on your Datasette instance to see the values of the environment variables.

## Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
cd datasette-expose-env
python3 -m venv venv
source venv/bin/activate
```
Now install the dependencies and test dependencies:
```bash
pip install -e '.[test]'
```
To run the tests:
```bash
pytest
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/simonw/datasette-expose-env",
    "name": "datasette-expose-env",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Simon Willison",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/dc/b5/c58a01d57fdefa168c8a704175d5ce253049e5a918431227a38491598795/datasette-expose-env-0.2.tar.gz",
    "platform": null,
    "description": "# datasette-expose-env\n\n[![PyPI](https://img.shields.io/pypi/v/datasette-expose-env.svg)](https://pypi.org/project/datasette-expose-env/)\n[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-expose-env?include_prereleases&label=changelog)](https://github.com/simonw/datasette-expose-env/releases)\n[![Tests](https://github.com/simonw/datasette-expose-env/workflows/Test/badge.svg)](https://github.com/simonw/datasette-expose-env/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-expose-env/blob/main/LICENSE)\n\nDatasette plugin to expose selected environment variables at `/-/env` for debugging\n\n## Installation\n\nInstall this plugin in the same environment as Datasette.\n```bash\ndatasette install datasette-expose-env\n```\n## Configuration\n\nDecide on a list of environment variables you would like to expose, then add the following to your `metadata.yml` configuration:\n\n```yaml\nplugins:\n  datasette-expose-env:\n    variables:\n    - ENV_VAR_1\n    - ENV_VAR_2\n    - ENV_VAR_3\n```\n\nIf you are using JSON in a `metadata.json` file use the following:\n\n```json\n{\n  \"plugins\": {\n    \"datasette-expose-env\": {\n      \"variables\": [\n        \"ENV_VAR_1\",\n        \"ENV_VAR_2\",\n        \"ENV_VAR_3\"\n      ]\n    }\n  }\n}\n```\nTo show a full list of redacted environment variables use `\"show_all_redacted\": true`:\n\n```yaml\nplugins:\n  datasette-expose-env:\n    show_all_redacted: true\n    variables:\n    - ENV_VAR_1\n    - ENV_VAR_2\n```\nThis will show the values for `ENV_VAR_1` and `ENV_VAR_2` and then a full list of other variables with their value shown as `...`.\n\n\nVisit `/-/env` on your Datasette instance to see the values of the environment variables.\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ncd datasette-expose-env\npython3 -m venv venv\nsource venv/bin/activate\n```\nNow install the dependencies and test dependencies:\n```bash\npip install -e '.[test]'\n```\nTo run the tests:\n```bash\npytest\n```\n",
    "bugtrack_url": null,
    "license": "Apache License, Version 2.0",
    "summary": "Datasette plugin to expose selected environment variables at /-/env for debugging",
    "version": "0.2",
    "project_urls": {
        "CI": "https://github.com/simonw/datasette-expose-env/actions",
        "Changelog": "https://github.com/simonw/datasette-expose-env/releases",
        "Homepage": "https://github.com/simonw/datasette-expose-env",
        "Issues": "https://github.com/simonw/datasette-expose-env/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0acb553cc0a3d4040e3e1d792df6c86126b5299da1f9809d0cf25ea2e26653c4",
                "md5": "dc1ab00ac00166b35ab3c8ec4d42f8ad",
                "sha256": "04c4b42c16ca1e66640fb9bb896792cb9beb6d566219a8f7d85758af89f7c1e8"
            },
            "downloads": -1,
            "filename": "datasette_expose_env-0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dc1ab00ac00166b35ab3c8ec4d42f8ad",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7216,
            "upload_time": "2024-03-03T00:07:36",
            "upload_time_iso_8601": "2024-03-03T00:07:36.930312Z",
            "url": "https://files.pythonhosted.org/packages/0a/cb/553cc0a3d4040e3e1d792df6c86126b5299da1f9809d0cf25ea2e26653c4/datasette_expose_env-0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dcb5c58a01d57fdefa168c8a704175d5ce253049e5a918431227a38491598795",
                "md5": "077df2c47a4d4205d3efd2f3f26a0d32",
                "sha256": "3d17c93daadd8f3a3a3996622de4bb6e9b3035135139a5a27502b73b98769d8c"
            },
            "downloads": -1,
            "filename": "datasette-expose-env-0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "077df2c47a4d4205d3efd2f3f26a0d32",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7286,
            "upload_time": "2024-03-03T00:07:37",
            "upload_time_iso_8601": "2024-03-03T00:07:37.897604Z",
            "url": "https://files.pythonhosted.org/packages/dc/b5/c58a01d57fdefa168c8a704175d5ce253049e5a918431227a38491598795/datasette-expose-env-0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-03 00:07:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "simonw",
    "github_project": "datasette-expose-env",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "datasette-expose-env"
}
        
Elapsed time: 0.25823s