Skip to content

usage

Models for tracking usage statistics for a user.

ResourceUsage pydantic-model

Bases: BaseModel

Response model for the get_usage_stats endpoint.

Fields:

analyses pydantic-field

The total number of analyses created by the user.

analysis_hours pydantic-field

Analysis hours usage information.

projects pydantic-field

The total number of projects created by the user.

recordings pydantic-field

The total number of recordings created by the user.

reports pydantic-field

The total number of reports created by the user.

storage pydantic-field

Storage usage information.

studies pydantic-field

The total number of studies created by the user.

is_within_limit(limit)

Check if the usage represented by this model is within a set of usage limits.

Calls the is_within_limit method on each of the UsageBase fields in this model and returns True if all of them return True and False otherwise. Also returns a list of field names indicating which limits are exceeded if any.

UsageBase pydantic-model

Bases: BaseModel

Base model for the UsageCount, UsageHours, and UsageBytes models.

The all_time field represents the total number of items counted over the lifetime of the account. The active field represents the total number of items actively in use by the user.

The fields can be non-negative integers or floats. The special case of None is also allowed to represent an unlimited resource when the UsageBase class is used to represent a set of limits on a resource instead of usage statistics. The increment and decrement methods cannot be used when the fields are None.

Fields:

  • all_time (NonNegativeFloat | NonNegativeInt | None)
  • active (NonNegativeFloat | NonNegativeInt | None)

active pydantic-field

Total number of items actively in use by the user.

all_time pydantic-field

Total number of items counted over the lifetime of the account.

is_within_limit(limit)

Check if the usage represented by this model is within a set of usage limits.

Check if the usage represented by this model is within a set of usage limits represented by the 'limit' model. The usage is satisfied if the all_time and active values in this model are less than or equal to the corresponding values in the 'limit' model or if the corresponding value in the limit model is None.

Examples:

  • if the all_time value in this model is 10 and the all_time value in the 'limit' model is 20, then this method will return True.
  • If the active value in this model is 10 and the active value in the 'limit' model is None, then this method will return True.
  • If the active value in this model is 10 and the active value in the 'limit' model is 5, then this method will return False.

UsageBytes pydantic-model

Bases: UsageBase

Represents the amount of storage in bytes used by a user.

Fields:

active = 0 pydantic-field

Total number of bytes of storage actively in use by the user.

all_time = 0 pydantic-field

Total number of bytes of storage used by the user over the lifetime of the account.

UsageCount pydantic-model

Bases: UsageBase

Represents a usage counter witch a all time and active value.

Fields:

active = 0 pydantic-field

Total number of items actively in use by the user.

all_time = 0 pydantic-field

Total number of items counted over the lifetime of the account.

UsageHours pydantic-model

Bases: UsageBase

Represents the number of hours of signal data processed by an analysis for a given user.

Fields:

active = 0.0 pydantic-field

Total number of hours of recordings analysed by the user.

all_time = 0.0 pydantic-field

Total number of hours of recoridngs analysed over the lifetime of the account.