Skip to main content

class User

(service_api: 'ServiceApi',
attrs: 'MutableMapping[str, Any]',
api_key: 'str | None' = None)

Description

A user on a W&B instance. This allows managing a user’s API keys and accessing information like team memberships. The create class method can be used to create a new user.

Args

  • service_api: The service API instance to use for querying W&B.
  • api_key:

Properties

property user_api

A wandb.Api instance using the user’s credentials.

property api_keys

Names of the user’s API keys. This property returns the names of the the API keys, not the secret associated with the key. The name of the key cannot be used as an API key. The list is empty if the user has no API keys or if API keys have not been loaded.

property teams

Names of the user’s teams. This is an empty list if the user has no team memberships or if teams data was not loaded.

Methods

method create

api: 'Api',
email: 'str',
admin: 'bool | None' = False
Create a new user. This is an internal method. Use the create_user() method of wandb.Api instead.
Arguments
  • api: The API instance to use to create the user.
  • email: The email for the user.
  • admin: Whether this user should be a global instance admin.

method delete_api_key

self,
api_key: 'str'
Delete a user’s API key. Only the owner of the key or an admin can delete it.
Arguments
  • api_key: The name of the API key to delete. Use one of the names returned by the api_keys property.

method generate_api_key

self,
description: 'str | None' = None
Generate a new API key.
Arguments
  • description: A description for the new API key. This can be used to identify the purpose of the API key.