Pluggable credentials storage and management for click CLI apps.
Project description
click-creds
Pluggable credentials storage and management for click CLI applications.
Uses ~/.netrc
file method which is used by popular CLI applications like Heroku CLI, AWS CLIs, etc.
Installation
Requires python version >=3.6
.
$ pip install click-creds
Quickstart
Here's an example cli.py
file.
#!/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
,
$ ./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
.
Changelog / Releases
All releases should be listed in the releases tab on GitHub.
See CHANGELOG for a more detailed listing.
License
This project is published with the BSD License. See https://choosealicense.com/licenses/bsd/ for more information about what this means.
Credits
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
click-creds-0.0.2.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for click_creds-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ec700e7462b8e3ec4782304d79bba672f938fd257b6dc54a1ee10fceea49f40 |
|
MD5 | 6b3c23396dc70b176b1e98fe3223f55b |
|
BLAKE2b-256 | 33938f71a899d7014827e994fe18787338b49581d761b87316ca66fb42024edc |