semvec/pypi-packages huggingface dataset:
click-auth 0.0.1
Pluggable auth and local credentials storage for click applications
License: BSD
Requires Python: >=3.6
Keywords: click netrc auth cli python

# click-auth

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


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

## Installation

```bash
$ pip install click-auth
```

## Quickstart

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

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

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

# Register "config" group
cli.add_command(click_auth.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
```


## Changelog / Releases

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

See [CHANGELOG](https://github.com/Eshaan7/click-auth/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)