Models

These models are used for argument and return value validation. They are based on the pydantic package.

Definitions

class avatars.models.ApiKey[source]

Response model for an API key.

created_at: Annotated[datetime, Field(title='Created At')] [Required]
expires_at: Annotated[datetime, Field(title='Expires At')] [Required]
id: Annotated[UUID, Field(title='Id')] [Required]
last_used_at: Annotated[datetime | None, Field(title='Last Used At')] = None
name: Annotated[str, Field(title='Name')] [Required]
revoked_at: Annotated[datetime | None, Field(title='Revoked At')] = None
class avatars.models.ApiKeyWithPlaintext[source]

API Key response model that includes the secret for creation.

created_at: Annotated[datetime, Field(title='Created At')] [Required]
expires_at: Annotated[datetime, Field(title='Expires At')] [Required]
id: Annotated[UUID, Field(title='Id')] [Required]
last_used_at: Annotated[datetime | None, Field(title='Last Used At')] = None
name: Annotated[str, Field(title='Name')] [Required]
plaintext: Annotated[str, Field(title='Plaintext')] [Required]
revoked_at: Annotated[datetime | None, Field(title='Revoked At')] = None
class avatars.models.CompatibilityStatus(*values)[source]
compatible = 'compatible'
incompatible = 'incompatible'
unknown = 'unknown'
class avatars.models.ExpirationDays(*values)[source]

Expiration preset in days (choose from 30/60/120/365)

integer_30 = 30
integer_60 = 60
integer_120 = 120
integer_365 = 365
class avatars.models.CreateApiKeyRequest[source]

Request body for creating an API key.

expiration_days: Annotated[ExpirationDays, Field(description='Expiration preset in days (choose from 30/60/120/365)', title='Expiration Days')] [Required]

Expiration preset in days (choose from 30/60/120/365)

name: Annotated[str, Field(description='Human-readable label for the API key', max_length=255, min_length=1, title='Name')] [Required]

Human-readable label for the API key

Constraints:
  • min_length = 1

  • max_length = 255

class avatars.models.CreateApiKeyResponse[source]

Response for API key creation.

api_key: ApiKeyWithPlaintext [Required]
message: Annotated[str, Field(title='Message')] [Required]
class avatars.models.CreditsInfo[source]
credits: Annotated[int | None, Field(title='Credits')] = None
is_credit_enabled: Annotated[bool, Field(title='Is Credit Enabled')] [Required]
class avatars.models.FeatureScope(*values)[source]
avatar_parameters = 'avatar_parameters'
single_table = 'single_table'
multi_table = 'multi_table'
time_series = 'time_series'
report = 'report'
geolocalization = 'geolocalization'
privacy_assessment = 'privacy_assessment'
differential_privacy = 'differential_privacy'
class avatars.models.FeaturesInfo[source]
feature_scopes: Annotated[List[FeatureScope], Field(title='Feature Scopes')] [Required]
class avatars.models.FileCredentials[source]
access_key_id: Annotated[str, Field(title='Access Key Id')] [Required]
jwt_token: Annotated[str | None, Field(title='Jwt Token')] = ''
secret_access_key: Annotated[str, Field(title='Secret Access Key')] [Required]
class avatars.models.ForgottenPasswordRequest[source]
email: Annotated[str, Field(title='Email')] [Required]
class avatars.models.JobCreateRequest[source]
depends_on: Annotated[List[str] | None, Field(title='Depends On')] = []
parameters_name: Annotated[str, Field(title='Parameters Name')] [Required]
set_name: Annotated[UUID, Field(title='Set Name')] [Required]
class avatars.models.JobCreateResponse[source]
Location: Annotated[str, Field(title='Location')] [Required]
name: Annotated[str, Field(title='Name')] [Required]
class avatars.models.JobKind(*values)[source]
standard = 'standard'
privacy_metrics = 'privacy_metrics'
signal_metrics = 'signal_metrics'
report = 'report'
advice = 'advice'
class avatars.models.JobResponse[source]
created_at: Annotated[datetime, Field(title='Created At')] [Required]
done: Annotated[bool, Field(title='Done')] [Required]
exception: Annotated[str, Field(title='Exception')] [Required]
kind: JobKind [Required]
name: Annotated[str, Field(title='Name')] [Required]
parameters_name: Annotated[str, Field(title='Parameters Name')] [Required]
progress: Annotated[float | None, Field(title='Progress')] = None
set_name: Annotated[UUID, Field(title='Set Name')] [Required]
status: Annotated[str, Field(title='Status')] [Required]
class avatars.models.JobWithDisplayNameResponse[source]
created_at: Annotated[datetime, Field(title='Created At')] [Required]
display_name: Annotated[str, Field(title='Display Name')] [Required]
done: Annotated[bool, Field(title='Done')] [Required]
exception: Annotated[str, Field(title='Exception')] [Required]
kind: JobKind [Required]
name: Annotated[str, Field(title='Name')] [Required]
parameters_name: Annotated[str, Field(title='Parameters Name')] [Required]
progress: Annotated[float | None, Field(title='Progress')] = None
set_name: Annotated[UUID, Field(title='Set Name')] [Required]
status: Annotated[str, Field(title='Status')] [Required]
class avatars.models.LoginResponse[source]
access_token: Annotated[str, Field(title='Access Token')] [Required]
refresh_token: Annotated[str | None, Field(title='Refresh Token')] = None
token_type: Annotated[str, Field(title='Token Type')] [Required]
class avatars.models.ResetPasswordRequest[source]
email: Annotated[str, Field(title='Email')] [Required]
new_password: Annotated[str, Field(title='New Password')] [Required]
new_password_repeated: Annotated[str, Field(title='New Password Repeated')] [Required]
token: Annotated[UUID, Field(title='Token')] [Required]
class avatars.models.ResourceSetResponse[source]
display_name: Annotated[str, Field(title='Display Name')] [Required]
set_name: Annotated[UUID, Field(title='Set Name')] [Required]
class avatars.models.UserRole(*values)[source]
admin = 'admin'
user = 'user'
class avatars.models.ValidationError[source]
loc: Annotated[List[str | int], Field(title='Location')] [Required]
msg: Annotated[str, Field(title='Message')] [Required]
type: Annotated[str, Field(title='Error Type')] [Required]
class avatars.models.GrantType[source]
root: Annotated[str, Field(pattern='^password$', title='Grant Type')] [Required]
Constraints:
  • pattern = ^password$

class avatars.models.Login[source]
client_id: Annotated[str | None, Field(title='Client Id')] = None
client_secret: Annotated[str | None, Field(title='Client Secret')] = None
grant_type: Annotated[GrantType | None, Field(title='Grant Type')] = None
password: Annotated[str, Field(title='Password')] [Required]
scope: Annotated[str | None, Field(title='Scope')] = ''
username: Annotated[str, Field(title='Username')] [Required]
class avatars.models.CompatibilityResponse[source]
message: Annotated[str, Field(title='Message')] [Required]
most_recent_compatible_client: Annotated[str | None, Field(title='Most Recent Compatible Client')] = None
status: CompatibilityStatus [Required]
class avatars.models.CreateUser[source]

Create a user, either with an email, or a username.

The choice will depend on how your server is setup.

email: Annotated[str | None, Field(title='Email')] = None
password: Annotated[str | None, Field(title='Password')] = None
role: UserRole | None = UserRole.user
username: Annotated[str | None, Field(title='Username')] = None
class avatars.models.FileAccess[source]
credentials: FileCredentials [Required]
url: Annotated[str, Field(title='Url')] [Required]
class avatars.models.HTTPValidationError[source]
detail: Annotated[List[ValidationError] | None, Field(title='Detail')] = None
class avatars.models.JobResponseList[source]
jobs: Annotated[List[JobWithDisplayNameResponse], Field(title='Jobs')] [Required]
class avatars.models.User[source]
email: Annotated[str | None, Field(title='Email')] = None
id: Annotated[UUID, Field(title='Id')] [Required]
organization_id: Annotated[UUID, Field(title='Organization Id')] [Required]
role: UserRole | None = UserRole.user
username: Annotated[str | None, Field(title='Username')] = None
class avatars.models.Processor(*args, **kwargs)[source]
preprocess(df: DataFrame) DataFrame[source]
postprocess(source: DataFrame, dest: DataFrame) DataFrame[source]
class avatar_yaml.models.parameters.AlignmentMethod(*values)[source]

Bases: str, Enum

SPECIFIED = 'specified'
MAX = 'max'
MIN = 'min'
MEAN = 'mean'
class avatar_yaml.models.parameters.ExcludeVariablesMethod(*values)[source]

Bases: str, Enum

The method to exclude column.

ROW_ORDER = 'row_order'

SENSITIVE The excluded column will be linked to the original row order. This is a violation of privacy.

COORDINATE_SIMILARITY = 'coordinate_similarity'

The excluded column will be linked by individual similarity.

class avatar_yaml.models.parameters.ImputeMethod(*values)[source]

Bases: str, Enum

KNN = 'knn'
MODE = 'mode'
MEDIAN = 'median'
MEAN = 'mean'
FAST_KNN = 'fast_knn'
class avatar_yaml.models.parameters.ProjectionType(*values)[source]

Bases: str, Enum

FPCA = 'fpca'
FLATTEN = 'flatten'
class avatar_yaml.models.schema.ColumnType(*values)[source]

Bases: StrEnum

INT = 'int'
BOOL = 'bool'
CATEGORY = 'category'
NUMERIC = 'float'
DATETIME = 'datetime'
DATETIME_TZ = 'datetime_tz'
class avatar_yaml.models.schema.LinkMethod(*values)[source]

Bases: StrEnum

Available assignment methods to link a child to its parent table after the anonymization.

LINEAR_SUM_ASSIGNMENT = 'linear_sum_assignment'

Assign using the linear sum assignment algorithm. This method is a good privacy and utility trade-off. The algorithm consumes lots of resources.

MINIMUM_DISTANCE_ASSIGNMENT = 'minimum_distance_assignment'

Assign using the minimum distance assignment algorithm. This method assigns the closest child to the parent. It is an acceptable privacy and utility trade-off. This algorithm consumes less resources than the linear sum assignment.

SENSITIVE_ORIGINAL_ORDER_ASSIGNMENT = 'sensitive_original_order_assignment'

Assign the child to the parent using the original order. WARNING!!! This method is a HIGH PRIVACY BREACH as it keeps the original order to assign the child to the parent. This method isn’t recommended for privacy reasons but consumes less resources than the other methods.

TIME_SERIES = 'time_series'

Specific assignment method for time series data. It is used to link time series data to the parent table.

class avatars.constants.PlotKind(*values)[source]

Bases: StrEnum

Available plot types for visualization.

CORRELATION = 'correlation'

A correlation heatmap of the original and avatar data.

CORRELATION_DIFFERENCE = 'correlation_difference'

A heatmap of the difference between the original and avatar data.

CONTRIBUTION = 'contribution'

A bar chart showing the contribution of each feature in the model.

PROJECTION_2D = '2d_projection'

A 2D projection of the original and avatar data.

PROJECTION_3D = '3d_projection'

A 3D projection of the original and avatar data.

DISTRIBUTION = 'distribution'

Distributions plot of the original and avatar data, there is a plot for each column.

AGGREGATE_STATS = 'aggregate_stats'

A table containing the mean and std of the original and avatar data (of the 10 first columns).

RAW_SERIES = 'raw_series'

A line plot of the original and avatar time series over time.

NORMALIZED_SERIES = 'normalized_series'

A line plot of the normalized original and avatar time series over time.

class avatars.constants.Results(*values)[source]

Bases: StrEnum

ADVICE = 'advice'
SHUFFLED = 'shuffled'
UNSHUFFLED = 'unshuffled'
PRIVACY_METRICS = 'privacy_metrics'
SIGNAL_METRICS = 'signal_metrics'
REPORT_IMAGES = 'report_images'
PROJECTIONS_ORIGINAL = 'original_projections'
PROJECTIONS_AVATARS = 'avatar_projections'
METADATA = 'run_metadata'
REPORT = 'report'
META_PRIVACY_METRIC = 'meta_privacy_metric'
META_SIGNAL_METRIC = 'meta_signal_metric'
FIGURES = 'figures'
FIGURES_METADATA = 'figures_metadata'