Skip to main content

Pluggable credentials storage and management for click CLI apps.

Project description

click-creds

pypi Build Status codecov CodeFactor Language grade: Python

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


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.3.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

click_creds-0.0.3-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file click-creds-0.0.3.tar.gz.

File metadata

  • Download URL: click-creds-0.0.3.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for click-creds-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1ee3e53ef25e7a5f13ca76033d450c648772cf9a1f8ea958b8fdcdf0aa87adfa
MD5 4f86a55cb3852d8f69583b8e2a9d1939
BLAKE2b-256 350cb3c6a69d717be53f98a064bdbdce3cf9c6da3d3c863889fecba4dc17f33b

See more details on using hashes here.

File details

Details for the file click_creds-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: click_creds-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for click_creds-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ea5e817e4f4cefc2b19910d9ff796f80ec2bbffa5f28ac7902c38a31d2490c36
MD5 1b7f24cea25cf94a012d6449c84c5467
BLAKE2b-256 864e1c65303d474e6ad7a923a7ca44c1b02eb57a81ac61fb907e273dae135cc8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page