Catalogue
blackline.models.catalogue
In an effort to meet the requirements for the Creative Commons Attribution 4.0 International License, please be aware that the following code is based on the following work: - https://github.com/ethyca/fideslang/blob/main/src/fideslang/models.py
The code has only been mildly modified to fit the needs of the Blackline project.
Contains all Pydantic models.
BlacklineModel
Bases: BaseModel
The base model for all Resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
Key
|
A unique key used to identify this resource. | required |
tags |
Optional[list[str]]
|
A list of tags for this resource. |
None
|
name |
Optional[str]
|
None
|
|
description |
Optional[str]
|
None
|
|
children |
Optional[dict[str, Type[BlacklineModel]]]
|
The children resources. |
None
|
stem |
str
|
The stem of the resource. | required |
children_stem |
Optional[str]
|
required | |
children_cls |
Optional[type[BlacklineModel]]
|
required |
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
Config
parse_children(path, key_prefix=None)
classmethod
Parse a directory of YAML files into a dictionary of Dataset objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
The path to the directory of YAML files. |
required |
path |
Path
|
Path |
required |
Returns:
Type | Description |
---|---|
dict[str, Type[BlacklineModel]]
|
A dictionary of Dataset objects. |
Source code in /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
parse_dir(path, key_prefix=None)
classmethod
Parse a directory of YAML files into a dictionary of Dataset objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
The path to the directory of YAML files. |
required |
path |
Path
|
Path |
required |
Returns:
Type | Description |
---|---|
A dictionary of Dataset objects. |
Source code in /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
parse_yaml(path, key, children={})
classmethod
Parse a yaml file into a the children_cls object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
Path location of the yaml file. |
required |
key |
str
|
Key to identify the dataset. |
required |
Returns:
Type | Description |
---|---|
Dataset object. |
Source code in /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
ContactDetails
Bases: BaseModel
The contact details information model.
Used to capture contact information for controllers, used as part of exporting a data map / ROPA.
This model is nested under an Organization and potentially under a system/dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
Optional[str]
|
An individual name used as part of publishing contact information. |
None
|
address |
Optional[str]
|
An individual address used as part of publishing contact information. |
None
|
Optional[str]
|
An individual email used as part of publishing contact information. |
None
|
|
phone |
Optional[str]
|
An individual phone number used as part of publishing contact information. |
None
|
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
DataProtectionImpactAssessment
Bases: BaseModel
The DataProtectionImpactAssessment (DPIA) resource model.
Contains information in regard to the data protection impact assessment exported on a data map or Record of Processing Activities (RoPA).
A legal requirement under GDPR for any project that introduces a high risk to personal information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
is_required |
bool
|
A boolean value determining if a data protection impact assessment is required. Defaults to False. |
False
|
status |
Optional[ImpactAssessmentStatusEnum]
|
The optional status of a Data Protection Impact Assessment. Returned on an exported data map or RoPA. |
None
|
link |
Optional[AnyUrl]
|
The optional link to the Data Protection Impact Assessment. Returned on an exported data map or RoPA. |
None
|
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
DataResponsibilityTitle
Bases: str
, Enum
The model defining the responsibility or role over the system that processes personal data.
Used to identify whether the organization is a Controller, Processor, or Sub-Processor of the data
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
DataSubjectRightsEnum
Bases: str
, Enum
The model for data subject rights over personal data.
Based upon chapter 3 of the GDPR
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
Dataset
Bases: BlacklineModel
The Dataset resource model.
Todo: This breaks the Liskov substitution principle because it restrics the BlacklineModel, not expand it. This model has no children.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
meta |
Optional[dict[str, str]]
|
None
|
|
data_categories |
Optional[list[Key]]
|
Array of Data Category resources identified by `key`, that apply to all collections in the Dataset. |
None
|
data_qualifier |
Key
|
required | |
joint_controller |
Optional[ContactDetails]
|
None
|
|
third_country_transfers |
Optional[list[str]]
|
An optional array to identify any third countries where data is transited to. For consistency purposes, these fields are required to follow the Alpha-3 code set in [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3). |
None
|
_check_valid_country_code |
classmethod
|
required | |
_alias | required | ||
children |
Optional[dict[str, DatasetCollection]]
|
None
|
|
stem | required | ||
children_stem | required | ||
children_cls | required | ||
collections |
Optional[dict[str, DatasetCollection]]
|
required |
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
DatasetCollection
Bases: BlacklineModel
The DatasetCollection resource model.
This resource is nested witin a Dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the collection. | required |
datetime_field |
Optional[DatetimeField]
|
The datetime field to use for the retention limit calculations. |
None
|
where |
Optional[str]
|
An addional where clause to append to the exeisting: 'WHERE {{ datetime_column }} < %(cutoff)s'. |
None
|
fields |
Optional[list[DatasetField]]
|
An array of objects that describe the collection's fields. |
None
|
data_categories |
Optional[list[Key]]
|
Array of Data Category resources identified by `key`, that apply to all fields in the collection. |
None
|
data_qualifier |
Key
|
required | |
_sort_fields |
classmethod
|
required | |
dependencies |
Optional[list[str]]
|
The collection dependencies. |
None
|
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
DatasetField
Bases: DatasetFieldBase
The DatasetField resource model.
This resource is nested within a DatasetCollection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fields |
Optional[list[DatasetField]]
|
An optional array of objects that describe hierarchical/nested fields (typically found in NoSQL databases). |
None
|
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
DatasetFieldBase
Bases: BaseModel
Base DatasetField Resource model.
This model is available for cases where the DatasetField information needs to be customized. In general this will not be the case and you will instead want to use the DatasetField model.
When this model is used you will need to implement your own recursive field in to adding any new needed fields.
Example:
from typing import list, Optional
from . import DatasetFieldBase
class MyDatasetField(DatasetFieldBase):
custom: str
fields: Optional[list[MyDatasetField]] = []
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
required | |
description |
Optional[str]
|
None
|
|
data_categories |
Optional[list[Key]]
|
Arrays of Data Categories, identified by `key`, that applies to this field. |
None
|
data_qualifier |
Key
|
required | |
deidentifier |
Optional[Union[Redact, Mask, Replace]]
|
The deidentifier to apply to this field. |
None
|
period |
timedelta
|
The period of time to retain data. | required |
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
ImpactAssessmentStatusEnum
Bases: str
, Enum
The model for impact assessment statuses.
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
IncludeExcludeEnum
Bases: str
, Enum
Determine whether or not defined rights are being included or excluded.
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
LegalBasisEnum
Bases: str
, Enum
The model for allowable legal basis categories
Based upon article 6 of the GDPR
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
Organization
Bases: BlacklineModel
The Organization resource model.
This resource is used as a way to organize all other resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
controller |
Optional[ContactDetails]
|
None
|
|
data_protection_officer |
Optional[ContactDetails]
|
None
|
|
representative |
Optional[ContactDetails]
|
None
|
|
security_policy |
Optional[HttpUrl]
|
Am optional URL to the organization security policy. |
None
|
children |
Optional[dict[str, System]]
|
System dict |
None
|
stem | required | ||
children_stem | required | ||
children_cls | required |
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
PrivacyDeclaration
Bases: BaseModel
The PrivacyDeclaration resource model.
States a function of a system, and describes how it relates to the privacy data types.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the privacy declaration on the system. | required |
data_categories |
list[Key]
|
An array of data categories describing a system in a privacy declaration. | required |
data_use |
Key
|
The Data Use describing a system in a privacy declaration. | required |
data_qualifier |
Optional[Key]
|
None
|
|
data_subjects |
list[Key]
|
An array of data subjects describing a system in a privacy declaration. | required |
dataset_references |
Optional[list[Key]]
|
Referenced Dataset keys used by the system. |
None
|
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
Resource
Bases: BlacklineModel
The System resource model.
Describes an application and includes a list of PrivacyDeclaration resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_type |
Optional[ResourceTypeEnum]
|
A required value to describe the type of system being modeled |
None
|
data_responsibility_title |
Optional[DataResponsibilityTitle]
|
None
|
|
privacy_declarations |
Optional[list[PrivacyDeclaration]]
|
None
|
|
dependencies |
Optional[list[Key]]
|
A list of keys to model dependencies. |
None
|
joint_controller |
Optional[ContactDetails]
|
None
|
|
third_country_transfers |
Optional[list[str]]
|
An optional array to identify any countries where data is transited to. For consistency purposes, these fields are required to follow the Alpha-3 code set in ISO 3166-1. |
None
|
administrating_department |
Optional[str]
|
The department or group that owns the resource |
None
|
data_protection_impact_assessment |
Optional[DataProtectionImpactAssessment]
|
None
|
|
children |
Optional[dict[str, Dataset]]
|
Dataset dict |
None
|
stem | required | ||
children_stem | required | ||
children_cls | required | ||
_sort_privacy_declarations |
classmethod
|
required | |
_no_self_reference |
classmethod
|
required | |
_check_valid_country_code |
classmethod
|
required |
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
ResourceTypeEnum
Bases: str
, Enum
The model for resource types.
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
SpecialCategoriesEnum
Bases: str
, Enum
The model for processing special categories of personal data.
Based upon article 9 of the GDPR
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
System
Bases: BlacklineModel
The System resource model.
Systems can be assigned to this resource, but it doesn't inherently point to any other resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
children |
Optional[dict[str, Resource]]
|
None
|
|
stem | required | ||
children_stem | required | ||
children_cls | required |