Reference¶
dapla_metadata package¶
Subpackages¶
Module contents¶
Tools and clients for working with the Dapla Metadata system.
dapla_metadata.datasets package¶
Subpackages¶
Submodules¶
dapla_metadata.datasets.code_list module¶
- class CodeList(executor, classification_id)¶
Bases:
GetExternalSource
Class for retrieving classifications from Klass.
This class fetches a classification given a classification ID and supports multiple languages.
- Parameters:
executor (ThreadPoolExecutor)
classification_id (int | None)
- supported_languages¶
A list of supported language codes.
- _classifications¶
A list to store classification items.
- classification_id¶
The ID of the classification to retrieve.
- classifications_dataframes¶
A dictionary to store dataframes of classifications.
- property classifications: list[CodeListItem]¶
Get the list of classifications.
- Returns:
A list of CodeListItem objects.
- class CodeListItem(titles, code)¶
Bases:
object
Data structure for a code list item.
- Parameters:
titles (dict[SupportedLanguages, str])
code (str)
- titles¶
A dictionary mapping language codes to titles.
- code¶
The code associated with the item.
-
code:
str
¶
- get_title(language)¶
Return the title in the specified language.
- Parameters:
language (
SupportedLanguages
) – The language code for which to get the title.- Return type:
str
- Returns:
The title in the specified language. It returns the title in Norwegian Bokmål (“nb”) if the language is either Norwegian Bokmål or Norwegian Nynorsk, otherwise it returns the title in English (“en”). If none of these are available, it returns an empty string and logs an exception.
-
titles:
dict
[SupportedLanguages
,str
]¶
dapla_metadata.datasets.config module¶
dapla_metadata.datasets.core module¶
Handle reading, updating and writing of metadata.
- class Datadoc(dataset_path=None, metadata_document_path=None, statistic_subject_mapping=None, *, errors_as_warnings=False)¶
Bases:
object
Handle reading, updating and writing of metadata.
If a metadata document exists, it is this information that is loaded. Nothing is inferred from the dataset. If only a dataset path is supplied the metadata document path is build based on the dataset path.
Example: /path/to/dataset.parquet -> /path/to/dataset__DOC.json
- Parameters:
dataset_path (str | None)
metadata_document_path (str | None)
statistic_subject_mapping (StatisticSubjectMapping | None)
errors_as_warnings (bool)
- dataset_path¶
A file path to the path to where the dataset is stored.
- metadata_document_path¶
A path to a metadata document if it exists.
- statistic_subject_mapping¶
An instance of StatisticSubjectMapping.
- static build_metadata_document_path(dataset_path)¶
Build the path to the metadata document corresponding to the given dataset.
- Parameters:
dataset_path (
Path
|CloudPath
) – Path to the dataset we wish to create metadata for.- Return type:
Path
|CloudPath
- property percent_complete: int¶
The percentage of obligatory metadata completed.
A metadata field is counted as complete when any non-None value is assigned. Used for a live progress bar in the UI, as well as being saved in the datadoc as a simple quality indicator.
- write_metadata_document()¶
Write all currently known metadata to file.
- Return type:
None
- Side Effects:
- Updates the dataset’s metadata_last_updated_date and
metadata_last_updated_by attributes.
Updates the dataset’s file_path attribute.
Validates the metadata model and stores it in a MetadataContainer.
- Writes the validated metadata to a file if the metadata_document
attribute is set.
Logs the action and the content of the metadata document.
- Raises:
ValueError – If no metadata document is specified for saving.
- Return type:
None
- exception InconsistentDatasetsError¶
Bases:
ValueError
Existing and new datasets differ significantly from one another.
- exception InconsistentDatasetsWarning¶
Bases:
UserWarning
Existing and new datasets differ significantly from one another.
dapla_metadata.datasets.dapla_dataset_path_info module¶
Extract info from a path following SSB’s dataset naming convention.
- class DaplaDatasetPathInfo(dataset_path)¶
Bases:
object
Extract info from a path following SSB’s dataset naming convention.
- Parameters:
dataset_path (str | os.PathLike[str])
- property bucket_name: str | None¶
Extract the bucket name from the dataset path.
- Returns:
The bucket name or None if the dataset path is not a GCS path.
Examples
>>> DaplaDatasetPathInfo('gs://ssb-staging-dapla-felles-data-delt/datadoc/utdata/person_data_p2021_v2.parquet').bucket_name ssb-staging-dapla-felles-data-delt
>>> DaplaDatasetPathInfo(pathlib.Path('gs://ssb-staging-dapla-felles-data-delt/datadoc/utdata/person_data_p2021_v2.parquet')).bucket_name ssb-staging-dapla-felles-data-delt
>>> DaplaDatasetPathInfo('gs:/ssb-staging-dapla-felles-data-delt/datadoc/utdata/person_data_p2021_v2.parquet').bucket_name ssb-staging-dapla-felles-data-delt
>>> DaplaDatasetPathInfo('ssb-staging-dapla-felles-data-delt/datadoc/utdata/person_data_p2021_v2.parquet').bucket_name None
- property contains_data_from: date | None¶
The earliest date from which data in the dataset is relevant for.
- Returns:
The earliest relevant date for the dataset if available, otherwise None.
- property contains_data_until: date | None¶
The latest date until which data in the dataset is relevant for.
- Returns:
The latest relevant date for the dataset if available, otherwise None.
- property dataset_short_name: str | None¶
Extract the dataset short name from the filepath.
The dataset short name is defined as the first section of the stem, up to the period information or the version information if no period information is present.
- Returns:
The extracted dataset short name if it can be determined, otherwise None.
Examples
>>> DaplaDatasetPathInfo('prosjekt/befolkning/klargjorte_data/person_data_v1.parquet').dataset_short_name person_data
>>> DaplaDatasetPathInfo('befolkning/inndata/sykepenger_p2022Q1_p2022Q2_v23.parquet').dataset_short_name sykepenger
>>> DaplaDatasetPathInfo('my_data/simple_dataset_name.parquet').dataset_short_name simple_dataset_name
- property dataset_state: DataSetState | None¶
Extract the dataset state from the path.
We assume that files are saved in the Norwegian language as specified by SSB.
- Returns:
The extracted dataset state if it can be determined from the path, otherwise None.
Examples
>>> DaplaDatasetPathInfo('klargjorte_data/person_data_v1.parquet').dataset_state <DataSetState.PROCESSED_DATA: 'PROCESSED_DATA'>
>>> DaplaDatasetPathInfo('klargjorte-data/person_data_v1.parquet').dataset_state <DataSetState.PROCESSED_DATA: 'PROCESSED_DATA'>
>>> DaplaDatasetPathInfo('utdata/min_statistikk/person_data_v1.parquet').dataset_state <DataSetState.OUTPUT_DATA: 'OUTPUT_DATA'>
>>> DaplaDatasetPathInfo('my_special_data/person_data_v1.parquet').dataset_state None
- property dataset_version: str | None¶
Extract version information if exists in filename.
- Returns:
The extracted version information if available in the filename, otherwise None.
Examples
>>> DaplaDatasetPathInfo('person_data_v1.parquet').dataset_version '1'
>>> DaplaDatasetPathInfo('person_data_v20.parquet').dataset_version '20'
>>> DaplaDatasetPathInfo('person_data.parquet').dataset_version None
- path_complies_with_naming_standard()¶
Check if path is valid according to SSB standard.
Read more about SSB naming convention in the Dapla manual: https://manual.dapla.ssb.no/statistikkere/navnestandard.html
- Return type:
bool
- Returns:
True if the path conforms to the SSB naming standard, otherwise False.
- property statistic_short_name: str | None¶
Extract the statistical short name from the filepath.
Extract the statistical short name from the filepath right before the dataset state based on the Dapla filepath naming convention.
- Returns:
The extracted statistical short name if it can be determined, otherwise None.
Examples
>>> DaplaDatasetPathInfo('prosjekt/befolkning/klargjorte_data/person_data_v1.parquet').statistic_short_name befolkning
>>> DaplaDatasetPathInfo('befolkning/inndata/person_data_v1.parquet').statistic_short_name befolkning
>>> DaplaDatasetPathInfo('befolkning/person_data.parquet').statistic_short_name None
- class DateFormat(name, regex_pattern, arrow_pattern, timeframe)¶
Bases:
ABC
A super class for date formats.
- Parameters:
name (str)
regex_pattern (str)
arrow_pattern (str)
timeframe (Literal['year', 'month', 'day', 'week'])
-
arrow_pattern:
str
¶
- abstract get_ceil(period_string)¶
Abstract method implemented in the child class.
Return the last date of the timeframe period.
- Parameters:
period_string (
str
) – A string representing the timeframe period.- Return type:
date
|None
- abstract get_floor(period_string)¶
Abstract method implemented in the child class.
Return the first date of the timeframe period.
- Parameters:
period_string (
str
) – A string representing the timeframe period.- Return type:
date
|None
-
name:
str
¶
-
regex_pattern:
str
¶
-
timeframe:
Literal
['year'
,'month'
,'day'
,'week'
]¶
- class IsoDateFormat(name, regex_pattern, arrow_pattern, timeframe)¶
Bases:
DateFormat
A subclass of Dateformat with relevant patterns for ISO dates.
- Parameters:
name (str)
regex_pattern (str)
arrow_pattern (str)
timeframe (Literal['year', 'month', 'day', 'week'])
- get_ceil(period_string)¶
Return last date of timeframe period defined in ISO date format.
- Return type:
date
|None
- Parameters:
period_string (str)
Examples
>>> ISO_YEAR.get_ceil("1921") datetime.date(1921, 12, 31)
>>> ISO_YEAR_MONTH.get_ceil("2021-05") datetime.date(2021, 5, 31)
- get_floor(period_string)¶
Return first date of timeframe period defined in ISO date format.
- Return type:
date
|None
- Parameters:
period_string (str)
Examples
>>> ISO_YEAR_MONTH.get_floor("1980-08") datetime.date(1980, 8, 1)
>>> ISO_YEAR.get_floor("2021") datetime.date(2021, 1, 1)
- class SsbDateFormat(name, regex_pattern, arrow_pattern, timeframe, ssb_dates)¶
Bases:
DateFormat
A subclass of Dateformat with relevant patterns for SSB unique dates.
- Parameters:
name (str)
regex_pattern (str)
arrow_pattern (str)
timeframe (Literal['year', 'month', 'day', 'week'])
ssb_dates (dict)
- ssb_dates¶
A dictionary where keys are date format strings and values are corresponding date patterns specific to SSB.
- get_ceil(period_string)¶
Return last date of the timeframe period defined in SSB date format.
Convert SSB format to date-string and return the last date.
- Parameters:
period_string (
str
) – A string representing the timeframe period in SSB format.- Return type:
date
|None
- Returns:
The last date of the period if the period_string is a valid SSB format, otherwise None.
Example
>>> SSB_TRIANNUAL.get_ceil("1999T11") None
>>> SSB_HALF_YEAR.get_ceil("2024H1") datetime.date(2024, 6, 30)
>>> SSB_HALF_YEAR.get_ceil("2024-H1") datetime.date(2024, 6, 30)
- get_floor(period_string)¶
Return first date of the timeframe period defined in SSB date format.
Convert SSB format to date-string and return the first date.
- Parameters:
period_string (
str
) – A string representing the timeframe period in SSB format.- Return type:
date
|None
- Returns:
The first date of the period if the period_string is a valid SSB format, otherwise None.
Example
>>> SSB_BIMESTER.get_floor("2003B8") None
>>> SSB_BIMESTER.get_floor("2003B4") datetime.date(2003, 7, 1)
>>> SSB_BIMESTER.get_floor("2003-B4") datetime.date(2003, 7, 1)
-
ssb_dates:
dict
¶
- categorize_period_string(period)¶
Categorize a period string into one of the supported date formats.
- Parameters:
period (
str
) – A string representing the period to be categorized.- Return type:
- Returns:
An instance of either IsoDateFormat or SsbDateFormat depending on the format of the input period string.
- Raises:
NotImplementedError – If the period string is not recognized as either an ISO or SSB date format.
Examples
>>> date_format = categorize_period_string('2022-W01') >>> date_format.name ISO_YEAR_WEEK
>>> date_format = categorize_period_string('1954T2') >>> date_format.name SSB_TRIANNUAL
>>> categorize_period_string('unknown format') Traceback (most recent call last): ... NotImplementedError: Period format unknown format is not supported
dapla_metadata.datasets.dataset_parser module¶
Abstractions for dataset file formats.
Handles reading in the data and transforming data types to generic metadata types.
- class DatasetParser(dataset)¶
Bases:
ABC
Abstract Base Class for all Dataset parsers.
Implements: - A static factory method to get the correct implementation for each file extension. - A static method for data type conversion.
Requires implementation by subclasses: - A method to extract variables (columns) from the dataset, so they may be documented.
- Parameters:
dataset (pathlib.Path | CloudPath)
- static for_file(dataset)¶
Return the correct subclass based on the given dataset file.
- Return type:
- Parameters:
dataset (Path | CloudPath)
- abstract get_fields()¶
Abstract method, must be implemented by subclasses.
- Return type:
list
[Variable
]
- static transform_data_type(data_type)¶
Transform a concrete data type to an abstract data type.
In statistical metadata, one is not interested in how the data is technically stored, but in the meaning of the data type. Because of this, we transform known data types to their abstract metadata representations.
If we encounter a data type we don’t know, we just ignore it and let the user handle it in the GUI.
- Parameters:
data_type (
str
) – The concrete data type to map.- Return type:
DataType
|None
- class DatasetParserParquet(dataset)¶
Bases:
DatasetParser
Concrete implementation for parsing parquet files.
- Parameters:
dataset (pathlib.Path | CloudPath)
- get_fields()¶
Extract the fields from this dataset.
- Return type:
list
[Variable
]
- class DatasetParserSas7Bdat(dataset)¶
Bases:
DatasetParser
Concrete implementation for parsing SAS7BDAT files.
- Parameters:
dataset (pathlib.Path | CloudPath)
- get_fields()¶
Extract the fields from this dataset.
- Return type:
list
[Variable
]
dapla_metadata.datasets.model_backwards_compatibility module¶
Upgrade old metadata files to be compatible with new versions.
An important principle of Datadoc is that we ALWAYS guarantee backwards compatibility of existing metadata documents. This means that we guarantee that a user will never lose data, even if their document is decades old.
For each document version we release with breaking changes, we implement a handler and register the version by defining a BackwardsCompatibleVersion instance. These documents will then be upgraded when they’re opened in Datadoc.
A test must also be implemented for each new version.
- class BackwardsCompatibleVersion(version, handler)¶
Bases:
object
A version which we support with backwards compatibility.
This class registers a version and its corresponding handler function for backwards compatibility.
- Parameters:
version (str)
handler (Callable[[dict[str, Any]], dict[str, Any]])
-
handler:
Callable
[[dict
[str
,Any
]],dict
[str
,Any
]]¶
-
version:
str
¶
- exception UnknownModelVersionError(supplied_version, *args)¶
Bases:
Exception
Exception raised for unknown model versions.
This error is thrown when an unrecognized model version is encountered.
- Parameters:
supplied_version (str)
args (tuple[Any, ...])
- Return type:
None
- add_container(existing_metadata)¶
Add container for previous versions.
Adds a container structure for previous versions of metadata. This function wraps the existing metadata in a new container structure that includes the ‘document_version’, ‘datadoc’, and ‘pseudonymization’ fields. The ‘document_version’ is set to “0.0.1” and ‘pseudonymization’ is set to None.
- Parameters:
existing_metadata (
dict
) – The original metadata dictionary to be wrapped.- Return type:
dict
- Returns:
A new dictionary containing the wrapped metadata with additional fields.
- handle_current_version(supplied_metadata)¶
Handle the current version of the metadata.
This function returns the supplied metadata unmodified.
- Parameters:
supplied_metadata (
dict
[str
,Any
]) – The metadata for the current version.- Return type:
dict
[str
,Any
]- Returns:
The unmodified supplied metadata.
- handle_version_0_1_1(supplied_metadata)¶
Handle breaking changes for version 0.1.1.
This function modifies the supplied metadata to accommodate breaking changes introduced in version 1.0.0. Specifically, it renames certain keys within the dataset and variables sections, and replaces empty string values with None for dataset keys.
- Parameters:
supplied_metadata (
dict
[str
,Any
]) – The metadata dictionary that needs to be updated.- Return type:
dict
[str
,Any
]- Returns:
The updated metadata dictionary.
References
PR ref: https://github.com/statisticsnorway/ssb-datadoc-model/pull/4
- handle_version_1_0_0(supplied_metadata)¶
Handle breaking changes for version 1.0.0.
This function modifies the supplied metadata to accommodate breaking changes introduced in version 2.1.0. Specifically, it updates the date fields ‘metadata_created_date’ and ‘metadata_last_updated_date’ to ISO 8601 format with UTC timezone. It also converts the ‘data_source’ field from a string to a dictionary with language keys if necessary and removes the ‘data_source_path’ field. The ‘document_version’ is updated to “2.1.0”.
- Parameters:
supplied_metadata (
dict
[str
,Any
]) – The metadata dictionary to be updated.- Return type:
dict
[str
,Any
]- Returns:
The updated metadata dictionary.
- handle_version_2_1_0(supplied_metadata)¶
Handle breaking changes for version 2.1.0.
This function modifies the supplied metadata to accommodate breaking changes introduced in version 2.2.0. Specifically, it updates the ‘owner’ field in the ‘dataset’ section of the supplied metadata dictionary by converting it from a LanguageStringType to a string. The ‘document_version’ is updated to “2.2.0”.
- Parameters:
supplied_metadata (
dict
[str
,Any
]) – The metadata dictionary to be updated.- Return type:
dict
[str
,Any
]- Returns:
The updated metadata dictionary.
- handle_version_2_2_0(supplied_metadata)¶
Handle breaking changes for version 2.2.0.
This function modifies the supplied metadata to accommodate breaking changes introduced in version 3.1.0. Specifically, it updates the ‘subject_field’ in the ‘dataset’ section of the supplied metadata dictionary by converting it to a string. It also removes the ‘register_uri’ field from the ‘dataset’. Additionally, it removes ‘sentinel_value_uri’ from each variable, sets ‘special_value’ and ‘custom_type’ fields to None, and updates language strings in the ‘variables’ and ‘dataset’ sections. The ‘document_version’ is updated to “3.1.0”.
- Parameters:
supplied_metadata (
dict
[str
,Any
]) – The metadata dictionary to be updated.- Return type:
dict
[str
,Any
]- Returns:
The updated metadata dictionary.
- handle_version_3_1_0(supplied_metadata)¶
Handle breaking changes for version 3.1.0.
This function modifies the supplied metadata to accommodate breaking changes introduced in version 3.2.0. Specifically, it updates the ‘data_source’ field in both the ‘dataset’ and ‘variables’ sections of the supplied metadata dictionary by converting value to string. The ‘document_version’ field is also updated to “3.2.0”.
- Parameters:
supplied_metadata (
dict
[str
,Any
]) – The metadata dictionary to be updated.- Return type:
dict
[str
,Any
]- Returns:
The updated metadata dictionary.
- handle_version_3_2_0(supplied_metadata)¶
Handle breaking changes for version 3.2.0.
This function modifies the supplied metadata to accommodate breaking changes introduced in version 3.3.0. Specifically, it updates the ‘contains_data_from’ and ‘contains_data_until’ fields in both the ‘dataset’ and ‘variables’ sections of the supplied metadata dictionary to ensure they are stored as date strings. It also updates the ‘document_version’ field to “3.3.0”.
- Parameters:
supplied_metadata (
dict
[str
,Any
]) – The metadata dictionary to be updated.- Return type:
dict
[str
,Any
]- Returns:
The updated metadata dictionary.
- handle_version_3_3_0(supplied_metadata)¶
Handle breaking changes for version 3.3.0.
This function modifies the supplied metadata to accommodate breaking changes introduced in version 4.0.0. Specifically, it removes the ‘direct_person_identifying’ field from each variable in ‘datadoc.variables’ and updates the ‘document_version’ field to “4.0.0”.
- Parameters:
supplied_metadata (
dict
[str
,Any
]) – The metadata dictionary to be updated.- Return type:
dict
[str
,Any
]- Returns:
The updated metadata dictionary.
- is_metadata_in_container_structure(metadata)¶
Check if the metadata is in the container structure.
At a certain point a metadata ‘container’ was introduced. The container provides a structure for different ‘types’ of metadata, such as ‘datadoc’, ‘pseudonymization’ etc. This function determines if the given metadata dictionary follows this container structure by checking for the presence of the ‘datadoc’ field.
- Parameters:
metadata (
dict
) – The metadata dictionary to check.- Return type:
bool
- Returns:
True if the metadata is in the container structure (i.e., contains the ‘datadoc’ field), False otherwise.
- upgrade_metadata(fresh_metadata)¶
Upgrade the metadata to the latest version using registered handlers.
This function checks the version of the provided metadata and applies a series of upgrade handlers to migrate the metadata to the latest version. It starts from the provided version and applies all subsequent handlers in sequence. If the metadata is already in the latest version or the version cannot be determined, appropriate actions are taken.
- Parameters:
fresh_metadata (
dict
[str
,Any
]) – The metadata dictionary to be upgraded. This dictionary must include version information that determines which handlers to apply.- Return type:
dict
[str
,Any
]- Returns:
The upgraded metadata dictionary, after applying all necessary handlers.
- Raises:
UnknownModelVersionError – If the metadata’s version is unknown or unsupported.
dapla_metadata.datasets.model_validation module¶
Handle validation for metadata with pydantic validators and custom warnings.
- exception ObligatoryDatasetWarning¶
Bases:
UserWarning
Custom warning for checking obligatory metadata for dataset.
- exception ObligatoryVariableWarning¶
Bases:
UserWarning
Custom warning for checking obligatory metadata for variables.
- class ValidateDatadocMetadata(**data)¶
Bases:
DatadocMetadata
Class that inherits from DatadocMetadata, providing additional validation.
- Parameters:
percentage_complete (int | None)
document_version (Literal['4.0.0'])
dataset (Dataset | None)
variables (list[Variable] | None)
- check_date_order()¶
Validate the order of date fields.
Check that dataset and variable date fields contains_data_from and contains_data_until are in chronological order.
Mode: This validator runs after other validation.
- Return type:
Self
- Returns:
The instance of the model after validation.
- Raises:
ValueError – If contains_data_until date is earlier than contains_data_from date.
- check_inherit_values()¶
Inherit values from dataset to variables if not set.
Sets values for ‘data source’, ‘temporality type’, ‘contains data from’, and ‘contains data until’ if they are None.
Mode: This validator runs after other validation.
- Return type:
Self
- Returns:
The instance of the model after validation.
- check_metadata_created_date()¶
Ensure metadata_created_date is set for the dataset.
Sets the current timestamp if metadata_created_date is None.
Mode: This validator runs after other validation.
- Return type:
Self
- Returns:
The instance of the model after validation.
- check_obligatory_dataset_metadata()¶
Check obligatory dataset fields and issue a warning if any are missing.
- Mode:
This validator runs after other validation.
- Return type:
Self
- Returns:
The instance of the model after validation.
- Raises:
ObligatoryDatasetWarning – If not all obligatory dataset metadata fields are filled in.
- check_obligatory_variables_metadata()¶
Check obligatory variable fields and issue a warning if any are missing.
- Mode:
This validator runs after other validation.
- Return type:
Self
- Returns:
The instance of the model after validation.
- Raises:
ObligatoryVariableWarning – If not all obligatory variable metadata fields are filled in.
- 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].
- exception ValidationWarning¶
Bases:
UserWarning
Custom warning for validation purposes.
- custom_warning_handler(message, category, filename, lineno, file=None, line=None)¶
Handle warnings.
- Return type:
None
- Parameters:
message (Warning | str)
category (type[Warning])
filename (str)
lineno (int)
file (TextIO | None)
line (str | None)
dapla_metadata.datasets.statistic_subject_mapping module¶
- class PrimarySubject(titles, subject_code, secondary_subjects)¶
Bases:
Subject
Data structure for primary subjects or ‘hovedemne’.
- Parameters:
titles (dict[str, str])
subject_code (str)
secondary_subjects (list[SecondarySubject])
-
secondary_subjects:
list
[SecondarySubject
]¶
- class SecondarySubject(titles, subject_code, statistic_short_names)¶
Bases:
Subject
Data structure for secondary subjects or ‘delemne’.
- Parameters:
titles (dict[str, str])
subject_code (str)
statistic_short_names (list[str])
-
statistic_short_names:
list
[str
]¶
- class StatisticSubjectMapping(executor, source_url)¶
Bases:
GetExternalSource
Provide mapping between statistic short name and primary and secondary subject.
- Parameters:
executor (ThreadPoolExecutor)
source_url (str | None)
- get_secondary_subject(statistic_short_name)¶
Looks up the secondary subject for the given statistic short name in the mapping dict.
Returns the secondary subject string if found, else None.
- Return type:
str
|None
- Parameters:
statistic_short_name (str | None)
- property primary_subjects: list[PrimarySubject]¶
Getter for primary subjects.
- class Subject(titles, subject_code)¶
Bases:
object
Base class for Primary and Secondary subjects.
A statistical subject is a related grouping of statistics.
- Parameters:
titles (dict[str, str])
subject_code (str)
- get_title(language)¶
Get the title in the given language.
- Return type:
str
- Parameters:
language (SupportedLanguages)
-
subject_code:
str
¶
-
titles:
dict
[str
,str
]¶
dapla_metadata.datasets.user_info module¶
Module contents¶
Document dataset.
dapla_metadata.datasets.utility package¶
Submodules¶
dapla_metadata.datasets.utility.constants module¶
Repository for constant values in Datadoc backend.
dapla_metadata.datasets.utility.enums module¶
Enumerations used in Datadoc.
- class SupportedLanguages(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
str
,Enum
The list of languages metadata may be recorded in.
Reference: https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
- ENGLISH = 'en'¶
- NORSK_BOKMÅL = 'nb'¶
- NORSK_NYNORSK = 'nn'¶
dapla_metadata.datasets.utility.utils module¶
- calculate_percentage(completed, total)¶
Calculate percentage as a rounded integer.
- Parameters:
completed (
int
) – The number of completed items.total (
int
) – The total number of items.
- Return type:
int
- Returns:
The rounded percentage of completed items out of the total.
- derive_assessment_from_state(state)¶
Derive assessment from dataset state.
- Parameters:
state (
DataSetState
) – The state of the dataset.- Return type:
Assessment
- Returns:
The derived assessment of the dataset.
- get_missing_obligatory_dataset_fields(dataset)¶
Identify all obligatory dataset fields that are missing values.
This function checks for obligatory fields that are either directly missing (i.e., set to None) or have multilanguage values with empty content.
- Parameters:
dataset (
Dataset
) – The dataset object to examine. This object must support the model_dump() method which returns a dictionary of field names and values.- Returns:
Fields that are directly None and are listed as obligatory metadata.
Multilanguage fields (listed as obligatory metadata`) where
the value exists but the primary language text is empty.
- Return type:
A list of field names (as strings) that are missing values. This includes
- get_missing_obligatory_variables_fields(variables)¶
Identify obligatory variable fields that are missing values for each variable.
This function checks for obligatory fields that are either directly missing (i.e., set to None) or have multilanguage values with empty content.
- Parameters:
variables (
list
) – A list of variable objects to check for missing obligatory fields.- Return type:
list
[dict
]- Returns:
A list of dictionaries with variable short names as keys and list of missing obligatory variable fields as values. This includes:
Fields that are directly None and are llisted as obligatory metadata.
Multilanguage fields (listed as obligatory metadata) where the value
exists but the primary language text is empty.
- get_timestamp_now()¶
Return a timestamp for the current moment.
- Return type:
datetime
- incorrect_date_order(date_from, date_until)¶
Evaluate the chronological order of two dates.
This function checks if ‘date until’ is earlier than ‘date from’. If so, it indicates an incorrect date order.
- Parameters:
date_from (
date
|None
) – The start date of the time period.date_until (
date
|None
) – The end date of the time period.
- Return type:
bool
- Returns:
True if ‘date_until’ is earlier than ‘date_from’ or if only ‘date_from’ is None, False otherwise.
Example
>>> incorrect_date_order(datetime.date(1980, 1, 1), datetime.date(1967, 1, 1)) True
>>> incorrect_date_order(datetime.date(1967, 1, 1), datetime.date(1980, 1, 1)) False
>>> incorrect_date_order(None, datetime.date(2024,7,1)) True
- merge_variables(existing_metadata, extracted_metadata, merged_metadata)¶
Merges variables from the extracted metadata into the existing metadata and updates the merged metadata.
This function compares the variables from extracted_metadata with those in existing_metadata. For each variable in extracted_metadata, it checks if a variable with the same short_name exists in existing_metadata. If a match is found, it updates the existing variable with information from extracted_metadata. If no match is found, the variable from extracted_metadata is directly added to merged_metadata.
- Parameters:
existing_metadata (
DatadocMetadata
) – The metadata object containing the current state of variables.extracted_metadata (
DatadocMetadata
) – The metadata object containing new or updated variables to merge.merged_metadata (
DatadocMetadata
) – The metadata object that will contain the result of the merge.
- Returns:
The merged_metadata object containing variables from both existing_metadata and extracted_metadata.
- Return type:
model.DatadocMetadata
- normalize_path(path)¶
Obtain a pathlib compatible Path.
Obtains a pathlib compatible Path regardless of whether the file is on a filesystem or in GCS.
- Parameters:
path (
str
) – Path on a filesystem or in cloud storage.- Return type:
Path
|CloudPath
- Returns:
Pathlib compatible object.
- num_obligatory_dataset_fields_completed(dataset)¶
Count the number of completed obligatory dataset fields.
This function returns the total count of obligatory fields in the dataset that have values (are not None).
- Parameters:
dataset (
Dataset
) – The dataset object for which to count the fields.- Return type:
int
- Returns:
The number of obligatory dataset fields that have been completed (not None).
- num_obligatory_variable_fields_completed(variable)¶
Count the number of obligatory fields completed for one variable.
This function calculates the total number of obligatory fields that have values (are not None) for one variable in the list.
- Parameters:
variable (
Variable
) – The variable to count obligatory fields for.- Return type:
int
- Returns:
The total number of obligatory variable fields that have been completed (not None) for one variable.
- num_obligatory_variables_fields_completed(variables)¶
Count the number of obligatory fields completed for all variables.
This function calculates the total number of obligatory fields that have values (are not None) for one variable in the list.
- Parameters:
variables (
list
) – A list with variable objects.- Return type:
int
- Returns:
The total number of obligatory variable fields that have been completed (not None) for all variables.
- override_dataset_fields(merged_metadata, existing_metadata)¶
Overrides specific fields in the dataset of merged_metadata with values from the dataset of existing_metadata.
This function iterates over a predefined list of fields, DATASET_FIELDS_FROM_EXISTING_METADATA, and sets the corresponding fields in the merged_metadata.dataset object to the values from the existing_metadata.dataset object.
- Parameters:
merged_metadata (
DatadocMetadata
) – An instance of DatadocMetadata containing the dataset to be updated.existing_metadata (
DatadocMetadata
) – An instance of DatadocMetadata containing the dataset whose values are used to update merged_metadata.dataset.
- Return type:
None
- Returns:
None.
- running_in_notebook()¶
Return True if running in Jupyter Notebook.
- Return type:
bool
- set_dataset_owner(dataset)¶
Sets the owner of the dataset from the DAPLA_GROUP_CONTEXT enviornment variable.
- Parameters:
dataset (
Dataset
) – The dataset object to set default values on.- Return type:
None
- set_default_values_dataset(dataset)¶
Set default values on dataset.
- Parameters:
dataset (
Dataset
) – The dataset object to set default values on.- Return type:
None
Example
>>> dataset = model.Dataset(id=None, contains_personal_data=None) >>> set_default_values_dataset(dataset) >>> dataset.id is not None True
>>> dataset.contains_personal_data == False True
- set_default_values_variables(variables)¶
Set default values on variables.
- Parameters:
variables (
list
) – A list of variable objects to set default values on.- Return type:
None
Example
>>> variables = [model.Variable(short_name="pers",id=None, is_personal_data = None), model.Variable(short_name="fnr",id='9662875c-c245-41de-b667-12ad2091a1ee', is_personal_data='PSEUDONYMISED_ENCRYPTED_PERSONAL_DATA')] >>> set_default_values_variables(variables) >>> isinstance(variables[0].id, uuid.UUID) True
>>> variables[1].is_personal_data == 'PSEUDONYMISED_ENCRYPTED_PERSONAL_DATA' True
>>> variables[0].is_personal_data == 'NOT_PERSONAL_DATA' True
- set_variables_inherit_from_dataset(dataset, variables)¶
Set specific dataset values on a list of variable objects.
This function populates ‘data source’, ‘temporality type’, ‘contains data from’, and ‘contains data until’ fields in each variable if they are not set (None). The values are inherited from the corresponding fields in the dataset.
- Parameters:
dataset (
Dataset
) – The dataset object from which to inherit values.variables (
list
) – A list of variable objects to update with dataset values.
- Return type:
None
Example
>>> dataset = model.Dataset(short_name='person_data_v1',data_source='01',temporality_type='STATUS',id='9662875c-c245-41de-b667-12ad2091a1ee',contains_data_from="2010-09-05",contains_data_until="2022-09-05") >>> variables = [model.Variable(short_name="pers",data_source =None,temporality_type = None, contains_data_from = None,contains_data_until = None)] >>> set_variables_inherit_from_dataset(dataset, variables) >>> variables[0].data_source == dataset.data_source True
>>> variables[0].temporality_type is None False
>>> variables[0].contains_data_from == dataset.contains_data_from True
>>> variables[0].contains_data_until == dataset.contains_data_until True
Module contents¶
Utility files for Datadoc.
dapla_metadata.datasets.external_sources package¶
Submodules¶
dapla_metadata.datasets.external_sources.external_sources module¶
- class GetExternalSource(executor)¶
Bases:
ABC
,Generic
[T
]Abstract base class for retrieving data from external sources asynchronously.
This class provides methods to initiate an asynchronous data retrieval operation, check its status, and retrieve the result once the operation completes. Subclasses must implement the _fetch_data_from_external_source method to define how data is fetched from the specific external source.
- Parameters:
executor (ThreadPoolExecutor)
- check_if_external_data_is_loaded()¶
Check if the thread getting the external data has finished running.
- Return type:
bool
- Returns:
True if the data fetching operation is complete, False otherwise.
- retrieve_external_data()¶
Retrieve the result of the data fetching operation.
This method checks if the asynchronous data fetching operation has completed. If the operation is finished, it returns the result. Otherwise, it returns None.
- Return type:
Optional
[TypeVar
(T
)]- Returns:
The result of the data fetching operation if it is complete or None if the operation has not yet finished.
- wait_for_external_result()¶
Wait for the thread responsible for loading the external request to finish.
If there is no future to wait for, it logs a warning and returns immediately.
- Return type:
None
Module contents¶
Abstract parent class for interacting with external resources asynchorously.
dapla_metadata.variable_definitions package¶
Subpackages¶
Module contents¶
Client for working with Variable Definitions at Statistics Norway.
dapla_metadata.variable_definitions.generated package¶
Subpackages¶
Module contents¶
dapla_metadata.variable_definitions.generated.vardef_client package¶
Subpackages¶
Submodules¶
dapla_metadata.variable_definitions.generated.vardef_client.api_client module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class ApiClient(configuration=None, header_name=None, header_value=None, cookie=None)¶
Bases:
object
Generic API client for OpenAPI client library builds.
OpenAPI generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of the methods and models for each application are generated from the OpenAPI templates.
- Parameters:
configuration – .Configuration object for this client
header_name – a header to pass when making calls to the API.
header_value – a header value to pass when making calls to the API.
cookie – a cookie to include in the header when making calls to the API
- NATIVE_TYPES_MAPPING = {'bool': <class 'bool'>, 'date': <class 'datetime.date'>, 'datetime': <class 'datetime.datetime'>, 'decimal': <class 'decimal.Decimal'>, 'float': <class 'float'>, 'int': <class 'int'>, 'long': <class 'int'>, 'object': <class 'object'>, 'str': <class 'str'>}¶
- PRIMITIVE_TYPES = (<class 'float'>, <class 'bool'>, <class 'bytes'>, <class 'str'>, <class 'int'>)¶
- call_api(method, url, header_params=None, body=None, post_params=None, _request_timeout=None)¶
Makes the HTTP request (synchronous) :type method: :param method: Method to call. :type url: :param url: Path to method endpoint. :type header_params: :param header_params: Header parameters to be
placed in the request header.
- Parameters:
body – Request body.
dict (post_params) – Request post form parameters, for application/x-www-form-urlencoded, multipart/form-data.
_request_timeout – timeout setting for this request.
- Return type:
- Returns:
RESTResponse
- deserialize(response_text, response_type, content_type)¶
Deserializes response into an object.
- Parameters:
response – RESTResponse object to be deserialized.
response_type (
str
) – class literal for deserialized object, or string of class name.content_type (
str
|None
) – content type of response.response_text (str)
- Returns:
deserialized object.
- files_parameters(files)¶
Builds form parameters.
- Parameters:
files (
dict
[str
,str
|bytes
|list
[str
] |list
[bytes
] |tuple
[str
,bytes
]]) – File parameters.- Returns:
Form parameters with files.
- classmethod get_default()¶
Return new instance of ApiClient.
This method returns newly created, based on default constructor, object of ApiClient class or returns a copy of default ApiClient.
- Returns:
The ApiClient object.
- param_serialize(method, resource_path, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, auth_settings=None, collection_formats=None, _host=None, _request_auth=None)¶
Builds the HTTP request params needed by the request. :type method: :param method: Method to call. :type resource_path: :param resource_path: Path to method endpoint. :type path_params: :param path_params: Path parameters in the url. :type query_params: :param query_params: Query parameters in the url. :type header_params: :param header_params: Header parameters to be
placed in the request header.
- Parameters:
body – Request body.
dict (files) – Request post form parameters, for application/x-www-form-urlencoded, multipart/form-data.
list (auth_settings) – Auth Settings names for the request.
dict – key -> filename, value -> filepath, for multipart/form-data.
collection_formats – dict of collection formats for path, query, header, and post parameters.
_request_auth – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- Return type:
tuple
[str
,str
,dict
[str
,str
],str
|None
,list
[str
]]- Returns:
tuple of form (path, http_method, query_params, header_params, body, post_params, files)
- parameters_to_tuples(params, collection_formats)¶
Get parameters as list of tuples, formatting collections.
- Parameters:
params – Parameters as dict or list of two-tuples
collection_formats (dict) – Parameter collection formats
- Returns:
Parameters as list of tuples, collections formatted
- parameters_to_url_query(params, collection_formats)¶
Get parameters as list of tuples, formatting collections.
- Parameters:
params – Parameters as dict or list of two-tuples
collection_formats (dict) – Parameter collection formats
- Returns:
URL query string (e.g. a=Hello%20World&b=123)
- response_deserialize(response_data, response_types_map=None)¶
Deserializes response into an object. :type response_data:
RESTResponse
:param response_data: RESTResponse object to be deserialized. :type response_types_map:dict
[str
,TypeVar
(T
)] |None
:param response_types_map: dict of response types. :rtype:ApiResponse
:return: ApiResponse- Parameters:
response_data (RESTResponse)
response_types_map (dict[str, T] | None)
- Return type:
- sanitize_for_serialization(obj)¶
Builds a JSON POST object.
If obj is None, return None. If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date
convert to string in iso8601 format.
If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict.
- Parameters:
obj – The data to serialize.
- Returns:
The serialized form of data.
- select_header_accept(accepts)¶
Returns Accept based on an array of accepts provided.
- Parameters:
accepts (
list
[str
]) – List of headers.- Return type:
str
|None
- Returns:
Accept (e.g. application/json).
- select_header_content_type(content_types)¶
Returns Content-Type based on an array of content_types provided.
- Parameters:
content_types – List of content-types.
- Returns:
Content-Type (e.g. application/json).
- classmethod set_default(default)¶
Set default instance of ApiClient.
It stores default ApiClient.
- Parameters:
default – object of ApiClient.
- set_default_header(header_name, header_value)¶
- update_params_for_auth(headers, queries, auth_settings, resource_path, method, body, request_auth=None)¶
Updates header and query params based on authentication setting.
- Parameters:
headers – Header parameters dict to be updated.
queries – Query parameters tuple list to be updated.
auth_settings – Authentication setting identifiers list.
- Return type:
None
- Resource_path:
A string representation of the HTTP request resource path.
- Method:
A string representation of the HTTP request method.
- Body:
A object representing the body of the HTTP request.
The object type is the return value of sanitize_for_serialization(). :type request_auth: :param request_auth: if set, the provided settings will
override the token in the configuration.
- property user_agent¶
User agent for this API client
dapla_metadata.variable_definitions.generated.vardef_client.api_response module¶
API response object.
- class ApiResponse(**data)¶
Bases:
BaseModel
,Generic
[T
]API response object
- Parameters:
status_code (Annotated[int, Strict(strict=True)])
headers (Mapping[str, str] | None)
data (T)
raw_data (Annotated[bytes, Strict(strict=True)])
- data: T¶
- headers: Mapping[str, str] | None¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- raw_data: StrictBytes¶
- status_code: StrictInt¶
dapla_metadata.variable_definitions.generated.vardef_client.configuration module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class Configuration(host=None, api_key=None, api_key_prefix=None, username=None, password=None, access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, ignore_operation_servers=False, ssl_ca_cert=None, retries=None, *, debug=None)¶
Bases:
object
This class contains various settings of the API client.
- Parameters:
host – Base url.
debug (bool | None)
- :param ignore_operation_servers
Boolean to ignore operation servers for the API client. Config will use host as the base url regardless of the operation servers.
- Parameters:
api_key – Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret.
api_key_prefix – Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data.
username – Username for HTTP basic authentication.
password – Password for HTTP basic authentication.
access_token – Access token.
server_index – Index to servers configuration.
server_variables – Mapping with string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before.
server_operation_index – Mapping from operation ID to an index to server configuration.
server_operation_variables – Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before.
ssl_ca_cert – str - the path to a file of concatenated CA certificates in PEM format.
retries – Number of retries for API requests.
debug (bool | None)
- Example:
- access_token¶
Access token
- assert_hostname¶
Set this to True/False to enable/disable SSL hostname verification.
- auth_settings()¶
Gets Auth Settings dict for api client.
- Returns:
The Auth Settings information dict.
- cert_file¶
client certificate file
- connection_pool_maxsize¶
urllib3 connection pool’s maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel requests to the same host, which is often the case here. cpu_count * 5 is used as default value to increase performance.
- date_format¶
date format
- datetime_format¶
datetime format
- property debug¶
Debug status
- Parameters:
value – The debug status, True or False.
- Type:
bool
- get_api_key_with_prefix(identifier, alias=None)¶
Gets API key (with prefix if set).
- Parameters:
identifier – The identifier of apiKey.
alias – The alternative identifier of apiKey.
- Returns:
The token for api key authentication.
- get_basic_auth_token()¶
Gets HTTP basic authentication header (string).
- Returns:
The token for basic HTTP authentication.
- classmethod get_default()¶
Return the default configuration.
This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default configuration.
- Returns:
The configuration object.
- classmethod get_default_copy()¶
Deprecated. Please use get_default instead.
Deprecated. Please use get_default instead.
- Returns:
The configuration object.
- get_host_from_settings(index, variables=None, servers=None)¶
Gets host URL based on the index and variables :type index: :param index: array index of the host settings :type variables: :param variables: hash of variable and the corresponding value :type servers: :param servers: an array of host settings or None :return: URL based on host settings
- get_host_settings()¶
Gets an array of host settings
- Returns:
An array of host settings
- property host¶
Return generated host.
- ignore_operation_servers¶
Ignore operation servers
- key_file¶
client key file
- logger¶
Logging Settings
- property logger_file¶
Debug file location
-
logger_file_handler:
FileHandler
|None
¶ Log file handler
- property logger_format¶
Log format
- logger_stream_handler¶
Log stream handler
- password¶
Password for HTTP basic authentication
-
proxy:
str
|None
¶ Proxy URL
- proxy_headers¶
Proxy headers
- refresh_api_key_hook¶
function hook to refresh API key if expired
- retries¶
Adding retries to override urllib3 default value 3
- safe_chars_for_path_param¶
Safe chars for path_param
- server_operation_index¶
Default server index
- server_operation_variables¶
Default server variables
- classmethod set_default(default)¶
Set default instance of configuration.
It stores default configuration, which can be returned by get_default_copy method.
- Parameters:
default – object of Configuration
- socket_options¶
Options to pass down to the underlying urllib3 socket
- ssl_ca_cert¶
Set this to customize the certificate file to verify the peer.
- temp_folder_path¶
Temp file folder for downloading files
- tls_server_name¶
SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server.
- to_debug_report()¶
Gets the essential information for debugging.
- Returns:
The report for debugging.
- username¶
Username for HTTP basic authentication
- verify_ssl¶
SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server.
dapla_metadata.variable_definitions.generated.vardef_client.exceptions module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- exception ApiAttributeError(msg, path_to_item=None)¶
Bases:
OpenApiException
,AttributeError
- Return type:
None
- exception ApiException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
OpenApiException
- Parameters:
body (str | None)
data (Any | None)
- Return type:
None
- classmethod from_response(*, http_resp, body, data)¶
- Return type:
Self
- Parameters:
body (str | None)
data (Any | None)
- exception ApiKeyError(msg, path_to_item=None)¶
Bases:
OpenApiException
,KeyError
- Return type:
None
- exception ApiTypeError(msg, path_to_item=None, valid_classes=None, key_type=None)¶
Bases:
OpenApiException
,TypeError
- Return type:
None
- exception ApiValueError(msg, path_to_item=None)¶
Bases:
OpenApiException
,ValueError
- Return type:
None
- exception BadRequestException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
- Parameters:
body (str | None)
data (Any | None)
- Return type:
None
- exception ForbiddenException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
- Parameters:
body (str | None)
data (Any | None)
- Return type:
None
- exception NotFoundException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
- Parameters:
body (str | None)
data (Any | None)
- Return type:
None
- exception OpenApiException¶
Bases:
Exception
The base exception class for all OpenAPIExceptions
- exception ServiceException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
- Parameters:
body (str | None)
data (Any | None)
- Return type:
None
- exception UnauthorizedException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
- Parameters:
body (str | None)
data (Any | None)
- Return type:
None
- render_path(path_to_item)¶
Returns a string representation of a path
dapla_metadata.variable_definitions.generated.vardef_client.rest module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class RESTClientObject(configuration)¶
Bases:
object
- request(method, url, headers=None, body=None, post_params=None, _request_timeout=None)¶
Perform requests.
- Parameters:
method – http request method
url – http request url
headers – http request headers
body – request json body, for application/json
post_params – request post parameters, application/x-www-form-urlencoded and multipart/form-data
_request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
- class RESTResponse(resp)¶
Bases:
IOBase
- getheader(name, default=None)¶
Returns a given response header.
- getheaders()¶
Returns a dictionary of the response headers.
- read()¶
- is_socks_proxy_url(url)¶
Module contents¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
dapla_metadata.variable_definitions.generated.vardef_client.api package¶
Submodules¶
dapla_metadata.variable_definitions.generated.vardef_client.api.data_migration_api module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class DataMigrationApi(api_client=None)¶
Bases:
object
NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech
Do not edit the class manually.
- create_variable_definition_from_var_dok(vardok_id, active_group, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a variable definition from a VarDok variable definition.
Create a variable definition from a VarDok variable definition.
- Parameters:
vardok_id (str) – The ID of the definition in Vardok. (required)
active_group (str) – The group which the user currently represents. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
- create_variable_definition_from_var_dok_with_http_info(vardok_id, active_group, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a variable definition from a VarDok variable definition.
Create a variable definition from a VarDok variable definition.
- Parameters:
vardok_id (str) – The ID of the definition in Vardok. (required)
active_group (str) – The group which the user currently represents. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[CompleteResponse]
- Returns:
Returns the result object.
- create_variable_definition_from_var_dok_without_preload_content(vardok_id, active_group, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a variable definition from a VarDok variable definition.
Create a variable definition from a VarDok variable definition.
- Parameters:
vardok_id (str) – The ID of the definition in Vardok. (required)
active_group (str) – The group which the user currently represents. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
dapla_metadata.variable_definitions.generated.vardef_client.api.draft_variable_definitions_api module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class DraftVariableDefinitionsApi(api_client=None)¶
Bases:
object
NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech
Do not edit the class manually.
- create_variable_definition(active_group, draft, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a variable definition.
Create a variable definition. New variable definitions are automatically assigned status DRAFT and must include all required fields. Attempts to specify id or variable_status in a request will receive 400 BAD REQUEST responses.
- Parameters:
active_group (str) – The group which the user currently represents. (required)
draft (Draft) – (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
- create_variable_definition_with_http_info(active_group, draft, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a variable definition.
Create a variable definition. New variable definitions are automatically assigned status DRAFT and must include all required fields. Attempts to specify id or variable_status in a request will receive 400 BAD REQUEST responses.
- Parameters:
active_group (str) – The group which the user currently represents. (required)
draft (Draft) – (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[CompleteResponse]
- Returns:
Returns the result object.
- create_variable_definition_without_preload_content(active_group, draft, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a variable definition.
Create a variable definition. New variable definitions are automatically assigned status DRAFT and must include all required fields. Attempts to specify id or variable_status in a request will receive 400 BAD REQUEST responses.
- Parameters:
active_group (str) – The group which the user currently represents. (required)
draft (Draft) – (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- delete_variable_definition_by_id(variable_definition_id, active_group, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Delete a variable definition.
Delete a variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
None
- Returns:
Returns the result object.
- delete_variable_definition_by_id_with_http_info(variable_definition_id, active_group, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Delete a variable definition.
Delete a variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[NoneType]
- Returns:
Returns the result object.
- delete_variable_definition_by_id_without_preload_content(variable_definition_id, active_group, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Delete a variable definition.
Delete a variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- update_variable_definition_by_id(variable_definition_id, active_group, update_draft, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Update a variable definition.
Update a variable definition. Only the fields which need updating should be supplied.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
update_draft (UpdateDraft) – (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
- update_variable_definition_by_id_with_http_info(variable_definition_id, active_group, update_draft, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Update a variable definition.
Update a variable definition. Only the fields which need updating should be supplied.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
update_draft (UpdateDraft) – (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[CompleteResponse]
- Returns:
Returns the result object.
- update_variable_definition_by_id_without_preload_content(variable_definition_id, active_group, update_draft, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Update a variable definition.
Update a variable definition. Only the fields which need updating should be supplied.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
update_draft (UpdateDraft) – (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
dapla_metadata.variable_definitions.generated.vardef_client.api.patches_api module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class PatchesApi(api_client=None)¶
Bases:
object
NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech
Do not edit the class manually.
- create_patch(variable_definition_id, active_group, patch, valid_from=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a new patch for a variable definition.
Create a new patch for a variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
patch (Patch) – (required)
valid_from (date) – Valid from date for the specific validity period to be patched.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
- create_patch_with_http_info(variable_definition_id, active_group, patch, valid_from=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a new patch for a variable definition.
Create a new patch for a variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
patch (Patch) – (required)
valid_from (date) – Valid from date for the specific validity period to be patched.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[CompleteResponse]
- Returns:
Returns the result object.
- create_patch_without_preload_content(variable_definition_id, active_group, patch, valid_from=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a new patch for a variable definition.
Create a new patch for a variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
patch (Patch) – (required)
valid_from (date) – Valid from date for the specific validity period to be patched.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- get_patch(variable_definition_id, patch_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one concrete patch for the given variable definition.
Get one concrete patch for the given variable definition. The full object is returned for comparison purposes.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
patch_id (int) – ID of the patch to retrieve (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
- get_patch_with_http_info(variable_definition_id, patch_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one concrete patch for the given variable definition.
Get one concrete patch for the given variable definition. The full object is returned for comparison purposes.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
patch_id (int) – ID of the patch to retrieve (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[CompleteResponse]
- Returns:
Returns the result object.
- get_patch_without_preload_content(variable_definition_id, patch_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one concrete patch for the given variable definition.
Get one concrete patch for the given variable definition. The full object is returned for comparison purposes.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
patch_id (int) – ID of the patch to retrieve (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- list_patches(variable_definition_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all patches for the given variable definition.
List all patches for the given variable definition. The full object is returned for comparison purposes.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
list
[CompleteResponse
]- Returns:
Returns the result object.
- list_patches_with_http_info(variable_definition_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all patches for the given variable definition.
List all patches for the given variable definition. The full object is returned for comparison purposes.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[list[CompleteResponse]]
- Returns:
Returns the result object.
- list_patches_without_preload_content(variable_definition_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all patches for the given variable definition.
List all patches for the given variable definition. The full object is returned for comparison purposes.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
dapla_metadata.variable_definitions.generated.vardef_client.api.public_api module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class PublicApi(api_client=None)¶
Bases:
object
NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech
Do not edit the class manually.
- get_public_variable_definition_by_id(variable_definition_id, accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one variable definition.
Get one variable definition. This is rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
RenderedVariableDefinition
- Returns:
Returns the result object.
- get_public_variable_definition_by_id_with_http_info(variable_definition_id, accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one variable definition.
Get one variable definition. This is rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[RenderedVariableDefinition]
- Returns:
Returns the result object.
- get_public_variable_definition_by_id_without_preload_content(variable_definition_id, accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one variable definition.
Get one variable definition. This is rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- list_public_validity_periods(variable_definition_id, accept_language, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all validity periods.
List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
list
[RenderedVariableDefinition
]- Returns:
Returns the result object.
- list_public_validity_periods_with_http_info(variable_definition_id, accept_language, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all validity periods.
List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[list[RenderedVariableDefinition]]
- Returns:
Returns the result object.
- list_public_validity_periods_without_preload_content(variable_definition_id, accept_language, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all validity periods.
List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- list_public_variable_definitions(accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all variable definitions.
List all variable definitions. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
list
[RenderedVariableDefinition
]- Returns:
Returns the result object.
- list_public_variable_definitions_with_http_info(accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all variable definitions.
List all variable definitions. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[list[RenderedVariableDefinition]]
- Returns:
Returns the result object.
- list_public_variable_definitions_without_preload_content(accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all variable definitions.
List all variable definitions. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
dapla_metadata.variable_definitions.generated.vardef_client.api.validity_periods_api module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class ValidityPeriodsApi(api_client=None)¶
Bases:
object
NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech
Do not edit the class manually.
- create_validity_period(variable_definition_id, active_group, validity_period, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a new validity period for a variable definition.
Create a new validity period for a variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
validity_period (ValidityPeriod) – (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
- create_validity_period_with_http_info(variable_definition_id, active_group, validity_period, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a new validity period for a variable definition.
Create a new validity period for a variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
validity_period (ValidityPeriod) – (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[CompleteResponse]
- Returns:
Returns the result object.
- create_validity_period_without_preload_content(variable_definition_id, active_group, validity_period, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a new validity period for a variable definition.
Create a new validity period for a variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
active_group (str) – The group which the user currently represents. (required)
validity_period (ValidityPeriod) – (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- list_public_validity_periods_0(variable_definition_id, accept_language, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all validity periods.
List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
list
[RenderedVariableDefinition
]- Returns:
Returns the result object.
- list_public_validity_periods_0_with_http_info(variable_definition_id, accept_language, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all validity periods.
List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[list[RenderedVariableDefinition]]
- Returns:
Returns the result object.
- list_public_validity_periods_0_without_preload_content(variable_definition_id, accept_language, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all validity periods.
List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- list_validity_periods(variable_definition_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all validity periods.
List all validity periods.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
list
[CompleteResponse
]- Returns:
Returns the result object.
- list_validity_periods_with_http_info(variable_definition_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all validity periods.
List all validity periods.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[list[CompleteResponse]]
- Returns:
Returns the result object.
- list_validity_periods_without_preload_content(variable_definition_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all validity periods.
List all validity periods.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
dapla_metadata.variable_definitions.generated.vardef_client.api.variable_definitions_api module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class VariableDefinitionsApi(api_client=None)¶
Bases:
object
NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech
Do not edit the class manually.
- get_public_variable_definition_by_id_0(variable_definition_id, accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one variable definition.
Get one variable definition. This is rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
RenderedVariableDefinition
- Returns:
Returns the result object.
- get_public_variable_definition_by_id_0_with_http_info(variable_definition_id, accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one variable definition.
Get one variable definition. This is rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[RenderedVariableDefinition]
- Returns:
Returns the result object.
- get_public_variable_definition_by_id_0_without_preload_content(variable_definition_id, accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one variable definition.
Get one variable definition. This is rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- get_variable_definition_by_id(variable_definition_id, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one variable definition.
Get one variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
- get_variable_definition_by_id_with_http_info(variable_definition_id, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one variable definition.
Get one variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[CompleteResponse]
- Returns:
Returns the result object.
- get_variable_definition_by_id_without_preload_content(variable_definition_id, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get one variable definition.
Get one variable definition.
- Parameters:
variable_definition_id (str) – Unique identifier for the variable definition. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- list_public_variable_definitions_0(accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all variable definitions.
List all variable definitions. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
list
[RenderedVariableDefinition
]- Returns:
Returns the result object.
- list_public_variable_definitions_0_with_http_info(accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all variable definitions.
List all variable definitions. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[list[RenderedVariableDefinition]]
- Returns:
Returns the result object.
- list_public_variable_definitions_0_without_preload_content(accept_language, date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all variable definitions.
List all variable definitions. These are rendered in the given language, with the default being Norwegian Bokmål.
- Parameters:
accept_language (SupportedLanguages) – Render the variable definition in the given language. (required)
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
- list_variable_definitions(date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all variable definitions.
List all variable definitions.
- Parameters:
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
list
[CompleteResponse
]- Returns:
Returns the result object.
- list_variable_definitions_with_http_info(date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all variable definitions.
List all variable definitions.
- Parameters:
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
ApiResponse[list[CompleteResponse]]
- Returns:
Returns the result object.
- list_variable_definitions_without_preload_content(date_of_validity=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List all variable definitions.
List all variable definitions.
- Parameters:
date_of_validity (date) – List only variable definitions which are valid on this date.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
HTTPResponse
- Returns:
Returns the result object.
Module contents¶
dapla_metadata.variable_definitions.generated.vardef_client.models package¶
Submodules¶
dapla_metadata.variable_definitions.generated.vardef_client.models.complete_response module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class CompleteResponse(**data)¶
Bases:
BaseModel
Complete response For internal users who need all details while maintaining variable definitions.
- Parameters:
id (Annotated[str, Strict(strict=True)])
patch_id (Annotated[int, Strict(strict=True)])
name (LanguageStringType)
short_name (Annotated[str, Strict(strict=True)])
definition (LanguageStringType)
classification_reference (Annotated[str, Strict(strict=True)] | None)
unit_types (list[Annotated[str, Strict(strict=True)]])
subject_fields (list[Annotated[str, Strict(strict=True)]])
contains_special_categories_of_personal_data (Annotated[bool, Strict(strict=True)])
variable_status (VariableStatus | None)
measurement_type (Annotated[str, Strict(strict=True)] | None)
valid_from (date)
valid_until (date | None)
external_reference_uri (Annotated[str, Strict(strict=True)] | None)
comment (LanguageStringType | None)
related_variable_definition_uris (list[Annotated[str, Strict(strict=True)]] | None)
owner (Owner)
contact (Contact | None)
created_at (datetime)
created_by (Person | None)
last_updated_at (datetime)
last_updated_by (Person | None)
- classification_reference: StrictStr | None¶
- comment: LanguageStringType | None¶
- contact: Contact | None¶
- contains_special_categories_of_personal_data: StrictBool¶
- created_at: datetime¶
- created_by: Person | None¶
- definition: LanguageStringType¶
- external_reference_uri: StrictStr | None¶
- classmethod from_dict(obj)¶
Create an instance of CompleteResponse from a dict
- Return type:
Optional
[Self
]- Parameters:
obj (dict[str, Any] | None)
- classmethod from_json(json_str)¶
Create an instance of CompleteResponse from a JSON string
- Return type:
Optional
[Self
]- Parameters:
json_str (str)
- id: StrictStr¶
- last_updated_at: datetime¶
- last_updated_by: Person | None¶
- measurement_type: StrictStr | None¶
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: LanguageStringType¶
- owner: Owner¶
- patch_id: StrictInt¶
- short_name: StrictStr¶
- subject_fields: list[StrictStr]¶
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True): :rtype:
dict
[str
,Any
]None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- Return type:
dict[str, Any]
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
- unit_types: list[StrictStr]¶
- valid_from: date¶
- valid_until: date | None¶
- variable_status: VariableStatus | None¶
dapla_metadata.variable_definitions.generated.vardef_client.models.contact module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class Contact(**data)¶
Bases:
BaseModel
- Parameters:
title (LanguageStringType)
email (Annotated[str, Strict(strict=True)])
- email: StrictStr¶
- classmethod from_dict(obj)¶
Create an instance of Contact from a dict
- Return type:
Optional
[Self
]- Parameters:
obj (dict[str, Any] | None)
- classmethod from_json(json_str)¶
Create an instance of Contact from a JSON string
- Return type:
Optional
[Self
]- Parameters:
json_str (str)
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- title: LanguageStringType¶
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True): :rtype:
dict
[str
,Any
]None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- Return type:
dict[str, Any]
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
dapla_metadata.variable_definitions.generated.vardef_client.models.draft module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class Draft(**data)¶
Bases:
BaseModel
Create a Draft Variable Definition
- Parameters:
name (LanguageStringType)
short_name (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)])])
definition (LanguageStringType)
classification_reference (Annotated[str, Strict(strict=True)] | None)
unit_types (list[Annotated[str, Strict(strict=True)]])
subject_fields (list[Annotated[str, Strict(strict=True)]])
contains_special_categories_of_personal_data (Annotated[bool, Strict(strict=True)])
measurement_type (Annotated[str, Strict(strict=True)] | None)
valid_from (date)
external_reference_uri (Annotated[str, Strict(strict=True)] | None)
comment (LanguageStringType | None)
related_variable_definition_uris (list[Annotated[str, Strict(strict=True)]] | None)
contact (Contact | None)
- classification_reference: StrictStr | None¶
- comment: LanguageStringType | None¶
- contact: Contact | None¶
- contains_special_categories_of_personal_data: StrictBool¶
- definition: LanguageStringType¶
- external_reference_uri: StrictStr | None¶
- classmethod from_dict(obj)¶
Create an instance of Draft from a dict
- Return type:
Optional
[Self
]- Parameters:
obj (dict[str, Any] | None)
- classmethod from_json(json_str)¶
Create an instance of Draft from a JSON string
- Return type:
Optional
[Self
]- Parameters:
json_str (str)
- measurement_type: StrictStr | None¶
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: LanguageStringType¶
- short_name: Annotated[str, Field(strict=True)]¶
- classmethod short_name_validate_regular_expression(value)¶
Validates the regular expression
- subject_fields: list[StrictStr]¶
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True): :rtype:
dict
[str
,Any
]None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- Return type:
dict[str, Any]
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
- unit_types: list[StrictStr]¶
- valid_from: date¶
dapla_metadata.variable_definitions.generated.vardef_client.models.language_string_type module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class LanguageStringType(**data)¶
Bases:
BaseModel
- Parameters:
nb (Annotated[str, Strict(strict=True)] | None)
nn (Annotated[str, Strict(strict=True)] | None)
en (Annotated[str, Strict(strict=True)] | None)
- en: StrictStr | None¶
- classmethod from_dict(obj)¶
Create an instance of LanguageStringType from a dict
- Return type:
Optional
[Self
]- Parameters:
obj (dict[str, Any] | None)
- classmethod from_json(json_str)¶
Create an instance of LanguageStringType from a JSON string
- Return type:
Optional
[Self
]- Parameters:
json_str (str)
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- nb: StrictStr | None¶
- nn: StrictStr | None¶
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True): :rtype:
dict
[str
,Any
]None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- Return type:
dict[str, Any]
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
dapla_metadata.variable_definitions.generated.vardef_client.models.owner module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class Owner(**data)¶
Bases:
BaseModel
- Parameters:
team (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True), MinLen(min_length=1)])])
groups (Annotated[list[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True), MinLen(min_length=1)])]], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])])
- classmethod from_dict(obj)¶
Create an instance of Owner from a dict
- Return type:
Optional
[Self
]- Parameters:
obj (dict[str, Any] | None)
- classmethod from_json(json_str)¶
Create an instance of Owner from a JSON string
- Return type:
Optional
[Self
]- Parameters:
json_str (str)
- groups: Annotated[list[Annotated[str, Field(min_length=1, strict=True)]], Field(min_length=1)]¶
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- team: Annotated[str, Field(min_length=1, strict=True)]¶
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True): :rtype:
dict
[str
,Any
]None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- Return type:
dict[str, Any]
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
dapla_metadata.variable_definitions.generated.vardef_client.models.patch module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class Patch(**data)¶
Bases:
BaseModel
Create a new Patch version on a Published Variable Definition.
- Parameters:
name (LanguageStringType | None)
definition (LanguageStringType | None)
classification_reference (Annotated[str, Strict(strict=True)] | None)
unit_types (list[Annotated[str, Strict(strict=True)]] | None)
subject_fields (list[Annotated[str, Strict(strict=True)]] | None)
contains_special_categories_of_personal_data (Annotated[bool, Strict(strict=True)] | None)
variable_status (VariableStatus | None)
measurement_type (Annotated[str, Strict(strict=True)] | None)
valid_until (date | None)
external_reference_uri (Annotated[str, Strict(strict=True)] | None)
comment (LanguageStringType | None)
related_variable_definition_uris (list[Annotated[str, Strict(strict=True)]] | None)
owner (Owner | None)
contact (Contact | None)
- classification_reference: StrictStr | None¶
- comment: LanguageStringType | None¶
- contact: Contact | None¶
- contains_special_categories_of_personal_data: StrictBool | None¶
- definition: LanguageStringType | None¶
- external_reference_uri: StrictStr | None¶
- classmethod from_dict(obj)¶
Create an instance of Patch from a dict
- Return type:
Optional
[Self
]- Parameters:
obj (dict[str, Any] | None)
- classmethod from_json(json_str)¶
Create an instance of Patch from a JSON string
- Return type:
Optional
[Self
]- Parameters:
json_str (str)
- measurement_type: StrictStr | None¶
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: LanguageStringType | None¶
- owner: Owner | None¶
- subject_fields: list[StrictStr] | None¶
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True): :rtype:
dict
[str
,Any
]None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
OpenAPI readOnly fields are excluded.
- Return type:
dict[str, Any]
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
- unit_types: list[StrictStr] | None¶
- valid_until: date | None¶
- variable_status: VariableStatus | None¶
dapla_metadata.variable_definitions.generated.vardef_client.models.person module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class Person(**data)¶
Bases:
BaseModel
- Parameters:
code (Annotated[str, Strict(strict=True)])
name (Annotated[str, Strict(strict=True)])
- code: StrictStr¶
- classmethod from_dict(obj)¶
Create an instance of Person from a dict
- Return type:
Optional
[Self
]- Parameters:
obj (dict[str, Any] | None)
- classmethod from_json(json_str)¶
Create an instance of Person from a JSON string
- Return type:
Optional
[Self
]- Parameters:
json_str (str)
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: StrictStr¶
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True): :rtype:
dict
[str
,Any
]None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- Return type:
dict[str, Any]
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
dapla_metadata.variable_definitions.generated.vardef_client.models.supported_languages module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class SupportedLanguages(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
str
,Enum
Languages the application supports.
- EN = 'en'¶
- NB = 'nb'¶
- NN = 'nn'¶
- classmethod from_json(json_str)¶
Create an instance of SupportedLanguages from a JSON string
- Return type:
Self
- Parameters:
json_str (str)
dapla_metadata.variable_definitions.generated.vardef_client.models.update_draft module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class UpdateDraft(**data)¶
Bases:
BaseModel
Update variable definition Data structure with all fields optional for updating a Draft Variable Definition.
- Parameters:
name (LanguageStringType | None)
short_name (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)])] | None)
definition (LanguageStringType | None)
classification_reference (Annotated[str, Strict(strict=True)] | None)
unit_types (list[Annotated[str, Strict(strict=True)]] | None)
subject_fields (list[Annotated[str, Strict(strict=True)]] | None)
contains_special_categories_of_personal_data (Annotated[bool, Strict(strict=True)] | None)
variable_status (VariableStatus | None)
measurement_type (Annotated[str, Strict(strict=True)] | None)
valid_from (date | None)
external_reference_uri (Annotated[str, Strict(strict=True)] | None)
comment (LanguageStringType | None)
related_variable_definition_uris (list[Annotated[str, Strict(strict=True)]] | None)
owner (Owner | None)
contact (Contact | None)
- classification_reference: StrictStr | None¶
- comment: LanguageStringType | None¶
- contact: Contact | None¶
- contains_special_categories_of_personal_data: StrictBool | None¶
- definition: LanguageStringType | None¶
- external_reference_uri: StrictStr | None¶
- classmethod from_dict(obj)¶
Create an instance of UpdateDraft from a dict
- Return type:
Optional
[Self
]- Parameters:
obj (dict[str, Any] | None)
- classmethod from_json(json_str)¶
Create an instance of UpdateDraft from a JSON string
- Return type:
Optional
[Self
]- Parameters:
json_str (str)
- measurement_type: StrictStr | None¶
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: LanguageStringType | None¶
- owner: Owner | None¶
- short_name: Annotated[str, Field(strict=True)] | None¶
- classmethod short_name_validate_regular_expression(value)¶
Validates the regular expression
- subject_fields: list[StrictStr] | None¶
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True): :rtype:
dict
[str
,Any
]None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- Return type:
dict[str, Any]
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
- unit_types: list[StrictStr] | None¶
- valid_from: date | None¶
- variable_status: VariableStatus | None¶
dapla_metadata.variable_definitions.generated.vardef_client.models.validity_period module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class ValidityPeriod(**data)¶
Bases:
BaseModel
Create a new Validity Period on a Published Variable Definition.
- Parameters:
name (LanguageStringType | None)
definition (LanguageStringType)
classification_reference (Annotated[str, Strict(strict=True)] | None)
unit_types (list[Annotated[str, Strict(strict=True)]] | None)
subject_fields (list[Annotated[str, Strict(strict=True)]] | None)
contains_special_categories_of_personal_data (Annotated[bool, Strict(strict=True)] | None)
variable_status (VariableStatus | None)
measurement_type (Annotated[str, Strict(strict=True)] | None)
valid_from (date)
external_reference_uri (Annotated[str, Strict(strict=True)] | None)
comment (LanguageStringType | None)
related_variable_definition_uris (list[Annotated[str, Strict(strict=True)]] | None)
contact (Contact | None)
- classification_reference: StrictStr | None¶
- comment: LanguageStringType | None¶
- contact: Contact | None¶
- contains_special_categories_of_personal_data: StrictBool | None¶
- definition: LanguageStringType¶
- external_reference_uri: StrictStr | None¶
- classmethod from_dict(obj)¶
Create an instance of ValidityPeriod from a dict
- Return type:
Optional
[Self
]- Parameters:
obj (dict[str, Any] | None)
- classmethod from_json(json_str)¶
Create an instance of ValidityPeriod from a JSON string
- Return type:
Optional
[Self
]- Parameters:
json_str (str)
- measurement_type: StrictStr | None¶
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: LanguageStringType | None¶
- subject_fields: list[StrictStr] | None¶
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True): :rtype:
dict
[str
,Any
]None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
OpenAPI readOnly fields are excluded.
- Return type:
dict[str, Any]
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
- unit_types: list[StrictStr] | None¶
- valid_from: date¶
- variable_status: VariableStatus | None¶
dapla_metadata.variable_definitions.generated.vardef_client.models.variable_status module¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class VariableStatus(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
str
,Enum
Life cycle status of a variable definition.
- DRAFT = 'DRAFT'¶
- PUBLISHED_EXTERNAL = 'PUBLISHED_EXTERNAL'¶
- PUBLISHED_INTERNAL = 'PUBLISHED_INTERNAL'¶
- classmethod from_json(json_str)¶
Create an instance of VariableStatus from a JSON string
- Return type:
Self
- Parameters:
json_str (str)
Module contents¶
Variable Definitions
## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the active_group query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are DRAFT, PUBLISHED_INTERNAL and PUBLISHED_EXTERNAL. #### Draft When a Variable Definition is created it is assigned the status DRAFT. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to PUBLISHED_INTERNAL or PUBLISHED_EXTERNAL with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to PUBLISHED_EXTERNAL by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a valid_until date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a date_of_validity when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a valid_from date and optionally a valid_until date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
The version of the OpenAPI document: 0.1 Contact: metadata@ssb.no Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.