parameters: (ctx, key)
docstring: Print api key details to stdout.
docstring_summary: Print api key details to stdout.
docstring_tokens: Print api key details to stdout .
function: def show_api_key_details(ctx, key):
      """Print api key details to stdout."""
      db = configure_db("rw")
      with db_worker_session(db) as session:
          row = session.query(ApiKey).filter(ApiKey.valid_key == key).one_or_none()
          if row:
              api_key = Key.from_obj(row)
          else:
              api_key = None
  
      if api_key:
          table = [[name, value] for name, value in api_key.as_dict().items()]
          print_table(table, delimiter=" : ", stream_write=click_echo_no_nl)
      else:
          click.echo(f"API key '{key}' does not exist")
function_tokens: def show_api_key_details ( ctx , key ) : db = configure_db ( "rw" ) with db_worker_session ( db ) as session : row = session . query ( ApiKey ) . filter ( ApiKey . valid_key == key ) . one_or_none ( ) if row : api_key = Key . from_obj ( row ) else : api_key = None if api_key : table = [ [ name , value ] for name , value in api_key . as_dict ( ) . items ( ) ] print_table ( table , delimiter = " : " , stream_write = click_echo_no_nl ) else : click . echo ( f"API key '{key}' does not exist" )