tdw_catalog.metadata

attachment

class tdw_catalog.metadata.attachment.Field(key: str, value: str)[source]

Bases: MetadataField[str]

Attach any metadata files directly to the Dataset.

Attributes

valuestr

The id of the attachment resource this field represents

contract_owner

class tdw_catalog.metadata.contract_owner.Field(key: str, value: Team | None)[source]

Bases: RecommendedMetadataField[Team], Field

Team or department that owns the data license

Attributes

None

currency

class tdw_catalog.metadata.currency.Field(key: str, currency: str | None, amount: float | None)[source]

Bases: MetadataField[CurrencyFieldValue]

A field for currency values

Attributes

currencyOptional[str]

An optional three character string representation for this currency type (e.g. USD)

amount: Optional[float]

An optional fractional amount of currency for this currency field

data_cost

class tdw_catalog.metadata.data_cost.Field(key: str, currency: str | None, amount: float | None)[source]

Bases: RecommendedMetadataField[CurrencyFieldValue], Field

Track and report on the data license cost

Attributes

None

date_field

class tdw_catalog.metadata.date_field.Field(key: str, value: date | None)[source]

Bases: MetadataField[date]

Add dates to the Dataset to keep track of timelines or events

Attributes

None

decimal

class tdw_catalog.metadata.decimal.Field(key: str, value: float | None)[source]

Bases: MetadataField[float]

A field for confidence values or other fractional information

Attributes

None

license_expiry

class tdw_catalog.metadata.license_expiry.Field(key: str, value: date | None)[source]

Bases: RecommendedMetadataField[date], Field

Monitor data license term limits

Attributes

None

linked_dataset

class tdw_catalog.metadata.linked_dataset.Field(key: str, value: Dataset | None)[source]

Bases: MetadataField[Dataset]

Connect Datasets together to maintain lineage or increase discoverability

Attributes

None

list_field

class tdw_catalog.metadata.list_field.Field(key: str, value: T | None, list_items: List[str] | None)[source]

Bases: MetadataField[str]

A preconfigured set of options where one of the options may be applied to a Dataset

Attributes

list_itemsOptional[List[str]]

An optional list of values from which a user may choose a value

editor

class tdw_catalog.metadata.editor.MetadataEditor(fields: List[MetadataField], dataset: Dataset, template: MetadataTemplate | None = None)[source]

Bases: TemplatedMetadataEditor

A MetadataEditor assists with the alteration and updating of MetadataFields in a Dataset

add_alias_field(key: str, value: str | None) MetadataEditor[source]

An alternative unique identifier for this Dataset, for integrating with external systems

Parameters

keystr

An identifying key for the this field

valueOptional[str]

An optional str value for the alias this field represents

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

add_attachment_field(key: str, value: str) MetadataEditor[source]

Attach any metadata files directly to the Dataset

Parameters

keystr

A path for the file to be attached with this field

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

Raises

CatalogInternalException

If the call to the Catalog server fails when uploading the file to be attached

Team or department that owns the data license. The key of this field will automatically be set

Parameters

valueOptional[Team]

An optional Team object representing a team in this Organization

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

Raises

CatalogFailedPreconditionException

If the Dataset already has an attached contract owner field, templated or not

add_currency_field(key: str, currency: str | None, amount: float | None) MetadataEditor[source]

A field for currency values

Parameters

keystr

An identifying key for this field

currencyOptional[str]

An optional three character string representation for this currency type (e.g. USD)

amount: Optional[float]

An optional fractional amount of currency for this currency field

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

Track and report on the data license cost. The key of this field will automatically be set

Parameters

currencyOptional[str]

An optional three character string representation for this currency type (e.g. USD)

amount: Optional[float]

An optional fractional amount of currency for this currency field

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

Raises

CatalogFailedPreconditionException

If the Dataset already has an attached data cost field, templated or not

add_date_field(key: str, value: date | None) MetadataEditor[source]

Add dates to the Dataset to keep track of timelines or events

Parameters

keystr

An identifying key for this field

valueOptional[date]

An optional date object for the date this field represents

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

add_decimal_field(key: str, value: float | None) MetadataEditor[source]

A field for confidence values or other fractional information

Parameters

keystr

An identifying key for this field

valueOptional[float]

An optional float value for the decimal this field represents

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

Monitor data license term limits. The key of this field will automatically be set

Parameters

valueOptional[date]

An optional date value for the date that this field represents

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

Raises

CatalogFailedPreconditionException

If the Dataset already has an attached license expiry field, templated or not

Any links, urls, or websites associated with the Dataset

Parameters

keystr

An identifying key for this field

valueOptional[str]

An optional str value for the url this field represents

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

add_linked_dataset_field(key: str, value: Dataset | None) MetadataEditor[source]

Connect Datasets together to maintain lineage or increase discoverability

Parameters

keystr

An identifying key for this field

valueOptional[Dataset]

An optional object representing a Dataset that has been semantically linked to this field

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

add_number_field(key: str, value: int | None) MetadataEditor[source]

Track numbers associated with the Dataset, like total number of allowed users

Parameters

keystr

An identifying key for this field

valueOptional[int]

An optional int value for the number this field represents

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

add_organization_member_field(key: str, value: OrganizationMember | None) MetadataEditor[source]

Someone who is associated with the data

Parameters

keystr

An identifying key for this field

valueOptional[OrganizationMember]

An optional OrganizationMember value representing a member of this Dataset’s Organization

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

add_organization_team_field(key: str, value: Team | None) MetadataEditor[source]

A Team who is associated with the data

Parameters

keystr

An identifying key for this field

valueOptional[Team]

An optional Team value representing a team in this Dataset’s Organization

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

add_point_in_time_field(key: str, value: datetime | None) MetadataEditor[source]

A specific time and date associated with the Dataset

Parameters

keystr

An identifying key for this field

valueOptional[datetime]

An optional datetime value for the datetime this field represents

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

Primary person who manages the data license. The key of this field will automatically be set

Parameters

value: Optional[OrganizationMember]

An optional OrganizationMember object representing a member of this Organization

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

Raises

CatalogFailedPreconditionException

If the Dataset already has an attached point of contact field, templated or not

add_text_field(key: str, value: str | None) MetadataEditor[source]

Any additional text-based information you want to add to the Dataset

Parameters

keystr

An identifying key for the this field

valueOptional[str]

An optional str value for the text this field represents

Returns

MetadataEditor

Returns this MetadataEditor for further metadata editing

remove_field(key: str) MetadataEditor[source]

Remove a metadata field from the Dataset

Parameters

keystr

The key of the field to be removed

Returns

MetadataEditor

This MetadataEditor with the given field removed from its fields list

reorder(new_field_order: List[MetadataField]) MetadataEditor[source]

Reorder the fields list of this MetadataEditor

Parameters

new_field_orderList[MetadataField]

The newly ordered list of MetadataTemplateFields to replace the old list on this MetadataTemplate. Must contain the same fields as the original list, with the only allowed change being the list’s order

Returns

MetadataEditor

This MetadataEditor with a reordered fields list

Raises

CatalogInvalidArgumentException

If the user supplied fields list contains a field with a key that does not exist on this Dataset, the number of fields in the list provided does not match the number of fields on the Dataset, or if a provided field matches the key of a field in the original list but is of a different type

class tdw_catalog.metadata.editor.TemplatedMetadataEditor(fields: List[MetadataField], dataset: Dataset, template: MetadataTemplate | None = None)[source]

Bases: object

A TemplatedMetadataEditor assists with the alteration and updating of MetadataField values in a Dataset

get_field(key: str, cls: MetadataField[T] = None) MetadataField[T] | TemplatedMetadataField[T][source]

Get a specific metadata field belonging to this Dataset. The field’s properties can then be changed directly

Parameters

keystr

The key of the desired field

Returns

MetadataField[T] | TemplatedMetadataField[T]

The specificed field whose key matches the provided key

Raises

CatalogNotFoundException:

If no MetadataField with a matching key can be found

keys() List[str][source]

Return a list of keys for each field in this Dataset’s custom or templated fields list

Parameters

None

Returns

List[str]

A list of strings representing the keys for each field in this list

list_fields() List[MetadataField][source]

Return the list of fields currently being edited by this MetadataEditor

Parameters

None

Returns

List[MetadataField]

The list of MetadataFields currently being edited by this MetadataEditor

save() None[source]

Save and persist all changes made to the metadata of the Dataset

Parameters

None

Returns

None

Raises

CatalogInternalException

If the call to the Catalog server fails

CatalogPermissionDeniedException

If the user does not have permission to make changes to this Dataset

field

class tdw_catalog.metadata.field.MetadataField(key: str, value: T | None)[source]

Bases: Generic[T]

The base type for all custom metadata fields which can be added to a Dataset

Attributes

keystr

A key for this field, which must be unique among all metadata fields in a Dataset

valueOptional[T]

An optional value for MetadataFields produced from this MetadataField.

class tdw_catalog.metadata.field.RecommendedMetadataField(key: str, value: T)[source]

Bases: MetadataField[T]

A subclass of MetadataField representing one of license expiry, point of contact, data cost, or contract owner. The key of a RecommendedMetadataField cannot be changed

class tdw_catalog.metadata.field.TemplatedMetadataField(field: MetadataField[T])[source]

Bases: Generic[T]

A wrapper class for MetadataFields that come from an attached MetadataTemplate. TemplatedMetadataFields keys can not be changed on a Dataset.

number

class tdw_catalog.metadata.number.Field(key: str, value: int | None)[source]

Bases: MetadataField[int]

Track numbers associated with the Dataset, like total number of allowed users

Attributes

None

organization_member

class tdw_catalog.metadata.organization_member.Field(key: str, value: OrganizationMember | None)[source]

Bases: MetadataField[OrganizationMember]

Someone who is associated with the data

Attributes

None

organization_team

class tdw_catalog.metadata.organization_team.Field(key: str, value: Team | None)[source]

Bases: MetadataField[Team]

A team who is associated with the data

Attributes

None

point_in_time

class tdw_catalog.metadata.point_in_time.Field(key: str, value: datetime | None)[source]

Bases: MetadataField[datetime]

A specific time and date associated with the Dataset

Attributes

None

point_of_contact

class tdw_catalog.metadata.point_of_contact.Field(key: str, value: OrganizationMember | None)[source]

Bases: RecommendedMetadataField[OrganizationMember], Field

Primary person who manages the data license

Attributes

None

text

class tdw_catalog.metadata.text.Field(key: str, value: str | None)[source]

Bases: MetadataField[str]

Any additional text-based information you want to add to the Dataset

Attributes

None