CLI

_get_parser

msdss_users_api.cli._get_parser()[source]

Builds an argparse parser for the msdss-users command line tool.

Returns

An argparse parser for msdss-users.

Return type

argparse.ArgumentParser

Author

Richard Wen <rrwen.dev@gmail.com>

Example

from msdss_users_api.cli import _get_parser

parser = _get_parser()
parser.print_help()

_prompt_password

msdss_users_api.cli._prompt_password()[source]

Prompts the user for a password.

Returns

Password provided by user input.

Return type

str

Author

Richard Wen <rrwen.dev@gmail.com>

Example

from msdss_users_api.cli import _prompt_password
_prompt_password()

run

msdss_users_api.cli.run()[source]

Runs the msdss-users command.

Author

Richard Wen <rrwen.dev@gmail.com>

Example

>>> msdss-users --help
usage: ipykernel_launcher.py [-h] [--env_file ENV_FILE] [--key_path KEY_PATH]
                             {register,get,delete,reset,update,start} ...

Manages users with a database

optional arguments:
  -h, --help            show this help message and exit
  --env_file ENV_FILE   path of .env file
  --key_path KEY_PATH   path of key file

commands:
  {register,get,delete,reset,update,start}
    register            register a user
    get                 get user attributes
    delete              delete a user
    reset               reset user password
    update              update a user's attribute
    start               start a users api server

Create a user interactively:

>>> msdss-users register

Get user attributes:

>>> msdss-users get test@example.com

Update user attributes:

>>> msdss-users update test@example.com --is_verified True

Reset user password:

>>> msdss-users reset test@example.com

Delete a user:

>>> msdss-users delete test@example.com

Start an API server:

>>> msdss-users start