click-creds


Nameclick-creds JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/eshaan7/click-creds
SummaryPluggable credentials storage and management for click CLI apps.
upload_time2021-09-14 08:33:52
maintainer
docs_urlNone
authorEshaan Bansal
requires_python>=3.6
licenseBSD
keywords click credentials creds netrc auth cli python store
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # click-creds

[![pypi](https://img.shields.io/pypi/v/click-creds)](https://pypi.org/project/click-creds/)
[![Build Status](https://github.com/Eshaan7/click-creds/workflows/Linter%20&%20Tests/badge.svg?branch=main)](https://github.com/Eshaan7/click-creds/actions?query=workflow%3A%22Linter+%26+Tests%22)
[![codecov](https://codecov.io/gh/Eshaan7/click-creds/branch/main/graph/badge.svg?token=AeUhwwnaRW)](https://codecov.io/gh/Eshaan7/click-creds)
[![CodeFactor](https://www.codefactor.io/repository/github/eshaan7/click-creds/badge)](https://www.codefactor.io/repository/github/eshaan7/click-creds)
<a href="https://lgtm.com/projects/g/Eshaan7/click-creds/context:python">
  <img alt="Language grade: Python" src="https://img.shields.io/lgtm/grade/python/g/Eshaan7/click-creds.svg?logo=lgtm&logoWidth=18"/>
</a>


Pluggable credentials storage and management for [click](https://github.com/pallets/click/) CLI applications.

Uses [`~/.netrc` file method](https://www.mkssoftware.com/docs/man4/netrc.4.asp) which is used by popular CLI applications like [Heroku CLI](https://devcenter.heroku.com/articles/authentication#netrc-file-format), AWS CLIs, etc.

## Installation

Requires python version `>=3.6`.

```bash
$ pip install click-creds
```

## Quickstart

Here's an example `cli.py` file.

```python
#!/usr/bin/env python3
import click
import click_creds

@click.group(context_settings=dict(help_option_names=["-h", "--help"]))
@click_creds.use_netrcstore(
    name="myawesomeapp",
    mapping={"login": "username", "password": "api_key", "account": "url"},
)
def cli():
    pass

# Register "config" group
cli.add_command(click_creds.config_group)

# Entrypoint
if __name__ == "__main__":
    cli()
```

Now, if we execute `./cli.py config`,

```bash
$ ./cli.py config
Usage: cli.py config [OPTIONS] COMMAND [ARGS]...

  Set or view config variables

Options:
  -h, --help  Show this message and exit.

Commands:
  get  Echo config variables
  set  Update config variables
```

## Documentation

Please see the [`example_project`](https://github.com/Eshaan7/click-creds/tree/main/example_project).


## Changelog / Releases

All releases should be listed in the [releases tab on GitHub](https://github.com/Eshaan7/click-creds/releases).

See [CHANGELOG](https://github.com/Eshaan7/click-creds/blob/main/.github/CHANGELOG.md) for a more detailed listing.

## License

This project is published with the [BSD License](LICENSE). See [https://choosealicense.com/licenses/bsd/](https://choosealicense.com/licenses/BSD/) for more information about what this means.

## Credits

- [tinynetrc](https://github.com/sloria/tinynetrc)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eshaan7/click-creds",
    "name": "click-creds",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "click credentials creds netrc auth cli python store",
    "author": "Eshaan Bansal",
    "author_email": "eshaan7bansal@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/35/0c/b3c6a69d717be53f98a064bdbdce3cf9c6da3d3c863889fecba4dc17f33b/click-creds-0.0.3.tar.gz",
    "platform": "",
    "description": "# click-creds\n\n[![pypi](https://img.shields.io/pypi/v/click-creds)](https://pypi.org/project/click-creds/)\n[![Build Status](https://github.com/Eshaan7/click-creds/workflows/Linter%20&%20Tests/badge.svg?branch=main)](https://github.com/Eshaan7/click-creds/actions?query=workflow%3A%22Linter+%26+Tests%22)\n[![codecov](https://codecov.io/gh/Eshaan7/click-creds/branch/main/graph/badge.svg?token=AeUhwwnaRW)](https://codecov.io/gh/Eshaan7/click-creds)\n[![CodeFactor](https://www.codefactor.io/repository/github/eshaan7/click-creds/badge)](https://www.codefactor.io/repository/github/eshaan7/click-creds)\n<a href=\"https://lgtm.com/projects/g/Eshaan7/click-creds/context:python\">\n  <img alt=\"Language grade: Python\" src=\"https://img.shields.io/lgtm/grade/python/g/Eshaan7/click-creds.svg?logo=lgtm&logoWidth=18\"/>\n</a>\n\n\nPluggable credentials storage and management for [click](https://github.com/pallets/click/) CLI applications.\n\nUses [`~/.netrc` file method](https://www.mkssoftware.com/docs/man4/netrc.4.asp) which is used by popular CLI applications like [Heroku CLI](https://devcenter.heroku.com/articles/authentication#netrc-file-format), AWS CLIs, etc.\n\n## Installation\n\nRequires python version `>=3.6`.\n\n```bash\n$ pip install click-creds\n```\n\n## Quickstart\n\nHere's an example `cli.py` file.\n\n```python\n#!/usr/bin/env python3\nimport click\nimport click_creds\n\n@click.group(context_settings=dict(help_option_names=[\"-h\", \"--help\"]))\n@click_creds.use_netrcstore(\n    name=\"myawesomeapp\",\n    mapping={\"login\": \"username\", \"password\": \"api_key\", \"account\": \"url\"},\n)\ndef cli():\n    pass\n\n# Register \"config\" group\ncli.add_command(click_creds.config_group)\n\n# Entrypoint\nif __name__ == \"__main__\":\n    cli()\n```\n\nNow, if we execute `./cli.py config`,\n\n```bash\n$ ./cli.py config\nUsage: cli.py config [OPTIONS] COMMAND [ARGS]...\n\n  Set or view config variables\n\nOptions:\n  -h, --help  Show this message and exit.\n\nCommands:\n  get  Echo config variables\n  set  Update config variables\n```\n\n## Documentation\n\nPlease see the [`example_project`](https://github.com/Eshaan7/click-creds/tree/main/example_project).\n\n\n## Changelog / Releases\n\nAll releases should be listed in the [releases tab on GitHub](https://github.com/Eshaan7/click-creds/releases).\n\nSee [CHANGELOG](https://github.com/Eshaan7/click-creds/blob/main/.github/CHANGELOG.md) for a more detailed listing.\n\n## License\n\nThis project is published with the [BSD License](LICENSE). See [https://choosealicense.com/licenses/bsd/](https://choosealicense.com/licenses/BSD/) for more information about what this means.\n\n## Credits\n\n- [tinynetrc](https://github.com/sloria/tinynetrc)\n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Pluggable credentials storage and management for click CLI apps.",
    "version": "0.0.3",
    "project_urls": {
        "Documentation": "https://github.com/eshaan7/click-creds",
        "Funding": "https://www.paypal.me/eshaanbansal",
        "Homepage": "https://github.com/eshaan7/click-creds",
        "Source": "https://github.com/eshaan7/click-creds",
        "Tracker": "https://github.com/eshaan7/click-creds/issues"
    },
    "split_keywords": [
        "click",
        "credentials",
        "creds",
        "netrc",
        "auth",
        "cli",
        "python",
        "store"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "864e1c65303d474e6ad7a923a7ca44c1b02eb57a81ac61fb907e273dae135cc8",
                "md5": "1b7f24cea25cf94a012d6449c84c5467",
                "sha256": "ea5e817e4f4cefc2b19910d9ff796f80ec2bbffa5f28ac7902c38a31d2490c36"
            },
            "downloads": -1,
            "filename": "click_creds-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1b7f24cea25cf94a012d6449c84c5467",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 7339,
            "upload_time": "2021-09-14T08:33:50",
            "upload_time_iso_8601": "2021-09-14T08:33:50.489633Z",
            "url": "https://files.pythonhosted.org/packages/86/4e/1c65303d474e6ad7a923a7ca44c1b02eb57a81ac61fb907e273dae135cc8/click_creds-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "350cb3c6a69d717be53f98a064bdbdce3cf9c6da3d3c863889fecba4dc17f33b",
                "md5": "4f86a55cb3852d8f69583b8e2a9d1939",
                "sha256": "1ee3e53ef25e7a5f13ca76033d450c648772cf9a1f8ea958b8fdcdf0aa87adfa"
            },
            "downloads": -1,
            "filename": "click-creds-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "4f86a55cb3852d8f69583b8e2a9d1939",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 6573,
            "upload_time": "2021-09-14T08:33:52",
            "upload_time_iso_8601": "2021-09-14T08:33:52.089826Z",
            "url": "https://files.pythonhosted.org/packages/35/0c/b3c6a69d717be53f98a064bdbdce3cf9c6da3d3c863889fecba4dc17f33b/click-creds-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-09-14 08:33:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eshaan7",
    "github_project": "click-creds",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "click-creds"
}
        
Elapsed time: 0.14879s