Skip to content

project

Pydantic models related to projects.

NameCodesCreate pydantic-model

Bases: BaseModel

How many codes to issue for a project that codes file names.

Config:

  • extra: forbid

Fields:

count pydantic-field

How many codes to issue: one for each study about to be created or file about to be registered.

NameCodesOut pydantic-model

Bases: BaseModel

Codes issued for a project that codes file names, each for one study.

Fields:

codes pydantic-field

The codes, each 8 characters from A-Z and 2-9 without O and I, none ever issued before in the project. Name one study after each, once; a code unused for 30 days expires.

ProjectAnalysisConfig pydantic-model

Bases: BaseModel

One analysis configuration a project has completed results from.

Fields:

analysis_config_id pydantic-field

The configuration's stable identifier, as reports and analysis requests name it.

analysis_count pydantic-field

Completed analyses this configuration produced in the project.

name pydantic-field

Display name of the configuration.

study_count pydantic-field

Studies with at least one completed analysis from it.

ProjectBucket pydantic-model

Bases: BaseModel

Where a project kept at its organisation's site stores its recordings.

Config:

  • frozen: True

Fields:

bucket pydantic-field

The bucket's name.

endpoint_url pydantic-field

The bucket's endpoint, as its organization registered it.

prefix pydantic-field

The folder the project's uploads go into, youSleep/projects//. A file registered where it was found keeps its own key.

ProjectCreate pydantic-model

Bases: NamedEntityCreate

Create payload for a project. name is required.

Fields:

pseudonymisation pydantic-field

The project's pseudonymisation policy. Fixed when the project is created.

recordings_at_site = None pydantic-field

Where the project's recordings are stored: true for the organisation's bucket, false for the platform. Left out, the bucket when a new project can be stored there, else the platform. An organisation that keeps its recordings at its site stores every new project in its bucket. Fixed when the project is created.

visibility = Visibility.PRIVATE pydantic-field

Who can access the project: private (its owner only), org (every member of the organization) or shared (its owner plus the members it is explicitly shared with). Defaults to private.

ProjectListResponse pydantic-model

Bases: PaginatedResponse

A page of the projects you can open.

Fields:

ProjectOut pydantic-model

Bases: ProjectCreate

Project information available to user.

Fields:

analyses_count = 0 pydantic-field

Total number of analyses

analyzed_count = 0 pydantic-field

Recordings with >= 1 completed analysis

bucket = None pydantic-field

Where in its organisation's bucket a project kept at its site stores its recordings; null for a project on the platform, and from a server that predates it.

created_at pydantic-field

Creation timestamp of the project

created_by = None pydantic-field

The user who created the project (null if that user was deleted). Provenance only; it does not change when ownership does.

demographics_count = 0 pydantic-field

Subjects with at least one subject-metadata field (age/sex/BMI) set — counted per subject, so a person characterised on thirty nights counts once.

id pydantic-field

Unique identifier of the project

lights_complete_count = 0 pydantic-field

Studies with BOTH lights markers set (the statistics window is fully defined). The completeness headline pairs this with study_count.

owner_id = None pydantic-field

The member who owns the project: the only one who can change its visibility, share it or delete it. Ownership passes to the organization's owner when a member leaves.

recording_count = 0 pydantic-field

Number of recordings

recordings_at_site = False pydantic-field

Whether the project's recordings live in its organisation's bucket rather than on the platform. Fixed when the project is created; its analyses then run only on the organisation's own runners.

study_count = 0 pydantic-field

Number of studies

subject_count = 0 pydantic-field

Distinct subjects among the project's studies. A study with no subject key is its own subject, so a project where nobody set a key reads the same as study_count; where keys are set, this is how many people the studies belong to.

total_duration_ms = 0 pydantic-field

Total recording duration in ms

ProjectUpdate pydantic-model

Bases: NamedEntityUpdate

PATCH payload for a project — all fields are optional.

See NamedEntityUpdate for the universal PATCH semantics (omit-to-skip, include-to-set, null-to-clear).

Fields:

Validators:

visibility = None pydantic-field

If set, change who can access the project.

Pseudonymisation pydantic-model

Bases: BaseModel

A project's pseudonymisation policy: chosen when it is created, never changed.

The EDF patient and recording identification fields are blanked in every project, whatever its policy.

Config:

  • frozen: True
  • extra: forbid

Fields:

dates = RecordingDates.REAL pydantic-field

Whether recordings keep their start dates (real) or have them replaced by EDF+'s unknown date before upload (removed); the time of day stays either way.

file_names = FileNames.ORIGINAL pydantic-field

Whether recordings keep their file names (original) or carry a code instead (coded).