Skip to main content
GitHub source

class User

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:
  • client: The GraphQL client to use for network operations.
  • attrs: A subset of the User type in the GraphQL schema.

property User.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. Returns:
  • list[str]: The api_keys property value.

property User.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. Returns:
  • list[str]: The teams property value.

property User.user_api

A wandb.Api instance using the user’s credentials. Returns:
  • Api | None: The user_api property value.

method User.delete_api_key

delete_api_key(api_key: 'str') → bool
Delete a user’s API key. Only the owner of the key or an admin can delete it. Args:
  • api_key: The name of the API key to delete. Use one of the names returned by the api_keys property.
Returns: True on success, false on failure.

method User.generate_api_key

generate_api_key(description: 'str | None' = None) → str | None
Generate a new API key. Args:
  • description: A description for the new API key. This can be used to identify the purpose of the API key.
Returns: The generated API key (the full secret, not just the name), or None on failure.