Reference

ssb_poc_statlog_model package

ssb_poc_statlog_model.change_data_log module

class ChangeDataLog(**data)

Bases: StatlogBaseModel

Data model for data change log in a statistical production process.

Parameters:
  • statistics_name (str)

  • data_source (list[str])

  • data_target (str)

  • data_period (str)

  • variable_name (str | None)

  • change_event (ChangeEvent)

  • change_event_reason (ChangeEventReason | None)

  • change_datetime (AwareDatetime)

  • changed_by (str)

  • data_change_type (DataChangeType | None)

  • change_comment (str | None)

  • change_details (ChangeDetails | ChangeDetails1)

change_comment: str | None
change_datetime: AwareDatetime
change_details: ChangeDetails | ChangeDetails1
change_event: ChangeEvent
change_event_reason: ChangeEventReason | None
changed_by: str
data_change_type: DataChangeType | None
data_period: str
data_source: list[str]
data_target: str
model_config: ClassVar[ConfigDict] = {'use_enum_values': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

statistics_name: str
variable_name: str | None
class ChangeDetails(**data)

Bases: StatlogBaseModel

Detailed information about the change. Either a unit-id, old and new value if one row (unit) was affected, or number of rows affected if the process changed multiple rows (units).

Parameters:
  • detail_type (Literal['rows'])

  • rows_affected (int)

  • variable_name (str | None)

detail_type: Literal['rows']
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'use_enum_values': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

rows_affected: int
variable_name: str | None
class ChangeDetails1(**data)

Bases: StatlogBaseModel

Detailed information about the change. Either a unit-id, old and new value if one row (unit) was affected, or number of rows affected if the process changed multiple rows (units).

Parameters:
detail_type: Literal['unit']
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'use_enum_values': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

new_value: list[NewValueItem] | None
old_value: list[OldValueItem] | None
unit_id: list[UnitIdItem]
class ChangeEvent(*values)

Bases: str, Enum

How the event was triggered: Automatically changed (A), Manually changed (M), Manually approved with no change (MNC), Not reviewed (NOT).

A = 'A'
M = 'M'
MNC = 'MNC'
NOT = 'NOT'
class ChangeEventReason(*values)

Bases: str, Enum

Reason for change or approval: Other source (OTHER_SOURCE), Statistical review (REVIEW), Information from the data provider/registry owner (OWNER), Small/marginal unit (MARGINAL_UNIT), Data duplicate (DUPLICATE), Other reason (OTHER).

DUPLICATE = 'DUPLICATE'
MARGINAL_UNIT = 'MARGINAL_UNIT'
OTHER = 'OTHER'
OTHER_SOURCE = 'OTHER_SOURCE'
OWNER = 'OWNER'
REVIEW = 'REVIEW'
class DataChangeType(*values)

Bases: str, Enum

Data change type: Updated value (UPD), created new unit/row (NEW), or deleted unit/row (DEL).

DEL = 'DEL'
NEW = 'NEW'
UPD = 'UPD'
class NewValueItem(**data)

Bases: StatlogBaseModel

Parameters:
  • variable_name (str)

  • value (str)

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'use_enum_values': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str
variable_name: str
class OldValueItem(**data)

Bases: StatlogBaseModel

Parameters:
  • variable_name (str)

  • value (str)

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'use_enum_values': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str
variable_name: str
class UnitIdItem(**data)

Bases: StatlogBaseModel

Parameters:
  • unit_id_variable (str)

  • unit_id_value (str)

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'use_enum_values': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit_id_value: str
unit_id_variable: str

ssb_poc_statlog_model.quality_control_description module

class QualityControlDescription(**data)

Bases: StatlogBaseModel

Model for description of quality controls used in a statistical production.

Parameters:
model_config: ClassVar[ConfigDict] = {'use_enum_values': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

quality_control_description: str
quality_control_id: str
quality_control_type: QualityControlType
variables: list[Variable]
class QualityControlType(*values)

Bases: str, Enum

Quality control type: hard (H), soft (S), informative (I).

H = 'H'
I = 'I'
S = 'S'
class Variable(**data)

Bases: StatlogBaseModel

Parameters:

variable_description (str | None)

model_config: ClassVar[ConfigDict] = {'use_enum_values': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

variable_description: str | None

ssb_poc_statlog_model.quality_control_result module

class QualityControlResult(**data)

Bases: StatlogBaseModel

Schema for statistics quality control result.

Parameters:
  • statistics_name (str)

  • quality_control_id (str)

  • data_location (list[str])

  • data_period (str)

  • quality_control_datetime (AwareDatetime)

  • quality_control_results (QualityControlResults)

  • quality_result_comment (str | None)

  • quality_control_run_exception (str | None)

data_location: list[str]
data_period: str
model_config: ClassVar[ConfigDict] = {'use_enum_values': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

quality_control_datetime: AwareDatetime
quality_control_id: str
quality_control_results: QualityControlResults
quality_control_run_exception: str | None
quality_result_comment: str | None
statistics_name: str
class QualityControlResults(*values)

Bases: str, Enum

Quality control result: quality ok (0), quality issues detected (1), missing value detected (2).

field_0 = '0'
field_1 = '1'
field_2 = '2'