aitomic.nomad_nmr.Client

class aitomic.nomad_nmr.Client(url, username, password, auth_token, timeout=5.0)[source]

Client for interacting with a NOMAD server.

Use the methods on the client send requests to the NOMAD server.

Examples

Parameters:
  • url (str) – The URL of the NOMAD server.

  • username (str) – The username to use for authentication.

  • password (str) – The password to use for authentication.

  • auth_token (AuthToken) – The authentication token to use for requests.

  • timeout (float) – The timeout for requests.

Attributes

url

The URL of the NOMAD server.

username

The username to use for authentication.

password

The password to use for authentication.

auth_token

The authentication token to use for requests.

timeout

The timeout for requests.

Methods

auth

Make the client use a new authentication token.

auto_experiments

Get a collection of auto experiments.

groups

Get the groups on the server.

login

Create a new client by logging into the NOMAD server.

users

Get the users on the server.

auth()[source]

Make the client use a new authentication token.

Examples

Raises:

requests.HTTPError – If the authentication request fails.

Return type:

None

auto_experiments(query=None)[source]

Get a collection of auto experiments.

Examples

Parameters:

query (AutoExperimentQuery | None) – The query to use for filtering the experiments.

Returns:

The collection of auto experiments.

Raises:

requests.HTTPError – If the request fails.

Return type:

AutoExperiments

groups()[source]

Get the groups on the server.

Examples

Return type:

Groups

static login(url, *, username, password, timeout=5.0)[source]

Create a new client by logging into the NOMAD server.

Examples

Parameters:
  • url (str) – The URL of the NOMAD server.

  • username (str) – The username to use for authentication.

  • password (str) – The password to use for authentication.

  • timeout (float) – The timeout for requests.

Raises:

requests.HTTPError – If the login request fails.

Return type:

Client

users()[source]

Get the users on the server.

Examples

Return type:

Users

auth_token: AuthToken

The authentication token to use for requests.

password: str

The password to use for authentication.

timeout: float

The timeout for requests.

url: str

The URL of the NOMAD server.

username: str

The username to use for authentication.