aitomic.nomad_nmr.AuthToken

class aitomic.nomad_nmr.AuthToken(expires_at, token)[source]

Authentication token for the NOMAD server.

A token must be used to authenticate requests to the NOMAD server. Generally the token is produced internally by the Client via the Client.login() and Client.auth().

Examples

Refreshing the token

if client.auth_token.expired():
    client.auth()
Parameters:
  • expires_at (datetime) – The time when the token expires.

  • token (str) – The token itself.

Attributes

expires_at

The time at which the token expires.

token

The token value.

Methods

expired

Check if the token is expired.

expired()[source]

Check if the token is expired.

Return type:

bool

expires_at: datetime

The time at which the token expires.

token: str

The token value.