dotenv-cli


Namedotenv-cli JSON
Version 3.3.1 PyPI version JSON
download
home_pageNone
SummarySimple dotenv CLI.
upload_time2024-07-13 07:27:43
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2018 Bastian Venthur 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 dotenv cli .env
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # dotenv CLI

Dotenv-CLI provides the `dotenv` command. `dotenv` loads the `.env` file from
the current directory, puts the contents in the environment by either changing
existing- or adding new environment variables, and executes the given command.

`dotenv` supports alternative `.env` files like `.env.development` via the `-e`
or `--dotenv` parameters.

With the `--replace` flag, `dotenv` also provides an option to completely
replace the environment variables with the ones from the `.env` file, allowing
you to control exactly which environment variables are set.

`dotenv` provides bash completion, so you can use `dotenv` like this:

```bash
$ dotenv make <TAB>
all      clean    docs     lint     release  test
```

## Install

### Using PyPi

dotenv-cli is [available on PyPi][pypi], you can install it via:

[pypi]: https://pypi.org/project/dotenv-cli/

```bash
$ pip install dotenv-cli
```

### On Debian and Ubuntu

Alternatively, you can install dotenv-cli on Debian based distributions via:

```bash
# apt-get install dotenv-cli
```


## Usage

Create an `.env` file in the root of your project and populate it with some
values like so:

```sh
SOME_SECRET=donttrythisathome
SOME_CONFIG=foo
```

Just prepend the command you want to run with the extra environment variables
from the `.env` file with `dotenv`:

```bash
$ dotenv some-command
```

and those variables will be available in your environment variables.


## Rules

The parser understands the following:

* Basic unquoted values (`BASIC=basic basic`)
* Lines starting with `export` (`export EXPORT=foo`), so you can `source` the
  file in bash
* Lines starting with `#` are ignored (`# Comment`)
* Empty values (`EMPTY=`) become empty strings
* Inner quotes are maintained in basic values: `INNER_QUOTES=this 'is' a test`
  or `INNER_QUOTES2=this "is" a test`
* White spaces are trimmed from unquoted values: `TRIM_WHITESPACE=  foo  ` and
  maintained in quoted values:  `KEEP_WHITESPACE="  foo  "`
* Interpret escapes (e.g. `\n`) in double quoted values, keep them as-is in
  single quoted values.

Example `.env` file:

```sh
BASIC=basic basic
export EXPORT=foo
EMPTY=
INNER_QUOTES=this 'is' a test
INNER_QUOTES2=this "is" a test
TRIM_WHITESPACE= foo
KEEP_WHITESPACE="  foo  "
MULTILINE_DQ="multi\nline"
MULTILINE_SQ='multi\nline'
MULTILINE_NQ=multi\nline
#
# some comment
```

becomes:

```sh
$ dotenv env
BASIC=basic basic
EXPORT=foo
EMPTY=
INNER_QUOTES=this 'is' a test
INNER_QUOTES2=this "is" a test
TRIM_WHITESPACE=foo
KEEP_WHITESPACE=  foo
MULTILINE_DQ=multi
line
MULTILINE_SQ=multi\nline
MULTILINE_NQ=multi\nline
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dotenv-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "dotenv, cli, .env",
    "author": null,
    "author_email": "Bastian Venthur <mail@venthur.de>",
    "download_url": "https://files.pythonhosted.org/packages/e5/87/ed743b091094e37c1cf0a212f45540f9b3fb6b2411b558746e74c9c3848c/dotenv_cli-3.3.1.tar.gz",
    "platform": null,
    "description": "# dotenv CLI\n\nDotenv-CLI provides the `dotenv` command. `dotenv` loads the `.env` file from\nthe current directory, puts the contents in the environment by either changing\nexisting- or adding new environment variables, and executes the given command.\n\n`dotenv` supports alternative `.env` files like `.env.development` via the `-e`\nor `--dotenv` parameters.\n\nWith the `--replace` flag, `dotenv` also provides an option to completely\nreplace the environment variables with the ones from the `.env` file, allowing\nyou to control exactly which environment variables are set.\n\n`dotenv` provides bash completion, so you can use `dotenv` like this:\n\n```bash\n$ dotenv make <TAB>\nall      clean    docs     lint     release  test\n```\n\n## Install\n\n### Using PyPi\n\ndotenv-cli is [available on PyPi][pypi], you can install it via:\n\n[pypi]: https://pypi.org/project/dotenv-cli/\n\n```bash\n$ pip install dotenv-cli\n```\n\n### On Debian and Ubuntu\n\nAlternatively, you can install dotenv-cli on Debian based distributions via:\n\n```bash\n# apt-get install dotenv-cli\n```\n\n\n## Usage\n\nCreate an `.env` file in the root of your project and populate it with some\nvalues like so:\n\n```sh\nSOME_SECRET=donttrythisathome\nSOME_CONFIG=foo\n```\n\nJust prepend the command you want to run with the extra environment variables\nfrom the `.env` file with `dotenv`:\n\n```bash\n$ dotenv some-command\n```\n\nand those variables will be available in your environment variables.\n\n\n## Rules\n\nThe parser understands the following:\n\n* Basic unquoted values (`BASIC=basic basic`)\n* Lines starting with `export` (`export EXPORT=foo`), so you can `source` the\n  file in bash\n* Lines starting with `#` are ignored (`# Comment`)\n* Empty values (`EMPTY=`) become empty strings\n* Inner quotes are maintained in basic values: `INNER_QUOTES=this 'is' a test`\n  or `INNER_QUOTES2=this \"is\" a test`\n* White spaces are trimmed from unquoted values: `TRIM_WHITESPACE=  foo  ` and\n  maintained in quoted values:  `KEEP_WHITESPACE=\"  foo  \"`\n* Interpret escapes (e.g. `\\n`) in double quoted values, keep them as-is in\n  single quoted values.\n\nExample `.env` file:\n\n```sh\nBASIC=basic basic\nexport EXPORT=foo\nEMPTY=\nINNER_QUOTES=this 'is' a test\nINNER_QUOTES2=this \"is\" a test\nTRIM_WHITESPACE= foo\nKEEP_WHITESPACE=\"  foo  \"\nMULTILINE_DQ=\"multi\\nline\"\nMULTILINE_SQ='multi\\nline'\nMULTILINE_NQ=multi\\nline\n#\n# some comment\n```\n\nbecomes:\n\n```sh\n$ dotenv env\nBASIC=basic basic\nEXPORT=foo\nEMPTY=\nINNER_QUOTES=this 'is' a test\nINNER_QUOTES2=this \"is\" a test\nTRIM_WHITESPACE=foo\nKEEP_WHITESPACE=  foo\nMULTILINE_DQ=multi\nline\nMULTILINE_SQ=multi\\nline\nMULTILINE_NQ=multi\\nline\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2018 Bastian Venthur  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": "Simple dotenv CLI.",
    "version": "3.3.1",
    "project_urls": {
        "Changelog": "https://github.com/venthur/dotenv-cli/blob/master/CHANGELOG.md",
        "Documentation": "https://dotenv-cli.readthedocs.io/",
        "Source": "https://github.com/venthur/dotenv-cli"
    },
    "split_keywords": [
        "dotenv",
        " cli",
        " .env"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "454162e1169b8976ddd9b0c82f23bfc1315263874f49411074952fc65a7ac6f9",
                "md5": "efecaf0d054b452e0e611001814d889d",
                "sha256": "fc6fa389750849d2fc3abbdf9f7b9f372a6a17bef9fb570175785ae19dd4a53f"
            },
            "downloads": -1,
            "filename": "dotenv_cli-3.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "efecaf0d054b452e0e611001814d889d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6864,
            "upload_time": "2024-07-13T07:27:41",
            "upload_time_iso_8601": "2024-07-13T07:27:41.479190Z",
            "url": "https://files.pythonhosted.org/packages/45/41/62e1169b8976ddd9b0c82f23bfc1315263874f49411074952fc65a7ac6f9/dotenv_cli-3.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e587ed743b091094e37c1cf0a212f45540f9b3fb6b2411b558746e74c9c3848c",
                "md5": "0243bc4cfcc0c98db991a94d38430700",
                "sha256": "ec57d75bbeea870d322c4f38455e1ec927286180ed859f2e5f05f6a1ed22b9f7"
            },
            "downloads": -1,
            "filename": "dotenv_cli-3.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0243bc4cfcc0c98db991a94d38430700",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 8928,
            "upload_time": "2024-07-13T07:27:43",
            "upload_time_iso_8601": "2024-07-13T07:27:43.323052Z",
            "url": "https://files.pythonhosted.org/packages/e5/87/ed743b091094e37c1cf0a212f45540f9b3fb6b2411b558746e74c9c3848c/dotenv_cli-3.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-13 07:27:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "venthur",
    "github_project": "dotenv-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dotenv-cli"
}
        
Elapsed time: 1.08435s