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
Built Distribution
Close
Hashes for intelowl-click-creds-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecbb0344c95f290b74fb0759ddc33fcc76f34c012d852e10a875cea093f6d6a1 |
|
MD5 | febfbd071961063d1c9cf2345802808d |
|
BLAKE2b-256 | def259d0cd0ed33a9a5691c6d1ada33febf54a42a78a8700205b6049b49d0e93 |
Close
Hashes for intelowl_click_creds-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccfe41761d701175bddb5e35ff37fa6fa991a850e805fd5d49c16687e6df2b4e |
|
MD5 | 24c227b8cb09f2595696b67fa0377183 |
|
BLAKE2b-256 | 3e99d5c3ce10945fb528f508f18609d1a65665fbbfeb964cf331788b323395f6 |