tdw_catalog.metadata_template

class tdw_catalog.metadata_template.MetadataTemplate(client, **kwargs)[source]

Bases: EntityBase

MetadataTemplates encompass a standard set of MetadataTemplateFields which can be applied to Datasets within the Catalog

Attributes

idstr

The unique ID of the MetadataTemplate

organizationOrganization

The Organization to which this MetadataTemplate belongs

organization_idstr

The unique ID of the Organization to which this MetadataTemplate belongs

created_bystr

The unique user ID of the OrganizationMember who created this MetadataTemplate

created_by_memberOrganizationMember

The OrganizationMember who created this MetadataTemplate

titlestr

A title for this MetadataTemplate

descriptionOptional[str]

An optional description of this MetadataTemplate

fields: List[MetadataTemplateField]

This list of MetadataTemplateFields constitutes the fields which would be attached to a Dataset if this MetadataTemplate was assigned to the Dataset

created_atdatetime

The datetime at which this MetadataTemplate was created

updated_atdatetime

The datetime at which this MetadataTemplate was last updated

delete() None[source]

Delete this MetadataTemplate from the Organization. Datasets which employ this template will have their templated metadata shifted to custom metadata.

Parameters

None

Returns

None

Raises

CatalogInternalException

If call to the Catalog server fails

CatalogNotFoundException

If no MetadataTemplate is found matching the given ID

CatalogPermissionDeniedException

if the caller is not allowed to delete this MetadataTemplate

classmethod get(client: Catalog, organization_id: str, id: str)[source]

Retrieve a MetadataTemplate belonging to this Organization

Parameters

clientCatalog

The Catalog client of the Organization containing the MetadataTemplate

organization_idstr

The unique ID of the Organization

idstr

The unique ID of the MetadataTemplate

Returns

MetadataTemplate

The MetadataTemplate associated with the given ID

Raises

CatalogInternalException

If call to the Catalog server fails

CatalogNotFoundException

If no MetadataTemplate is found matching the provided ID

CatalogPermissionDeniedException

If the caller is not allowed to retrieve this MetadataTemplate

modify_fields() MetadataTemplateUpdateBuilder[source]

Returns an object that can be used to manage and modify fields within this template. Changes to the template are saved to the Catalog when .save() is called on the returned object.

Parameters

None

Returns

MetadataTemplateUpdateBuilder

A MetadataTemplateUpdateBuilder which allows for the addition, removal, updating, and reordering of fields for the MetadataTemplate.

save() MetadataTemplate[source]

Save and update this MetadataTemplate inside the Organization

Parameters

None

Returns

MetadataTemplate

The updated MetadataTemplate after it has been saved

Raises

CatalogInternalException

If call to the Catalog server fails

CatalogNotFoundException

If no MetadataTemplate is found inside the Organization matching the ID of the updated MetadataTemplate

CatalogPermissionDeniedException

If the caller is not allowed to update this MetadataTemplate

attachment

class tdw_catalog.metadata_template.attachment.Field(key: str, optional: bool | None)[source]

Bases: MetadataTemplateField[None]

Attach files as metadata directly to a Dataset. Default attachment values are not currently supported.

Attributes

None

contract_owner

class tdw_catalog.metadata_template.contract_owner.Field(key: str, default_value: Team | None, optional: bool | None)[source]

Bases: RecommendedTemplateMetadataField[Team], Field

The Team that owns the data license

Attributes

None

currency

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

Bases: MetadataTemplateField[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_template.data_cost.Field(key: str, currency: str | None, amount: float | None, optional: bool | None)[source]

Bases: RecommendedTemplateMetadataField[CurrencyFieldValue], Field

Track and report on the data license cost

Attributes

None

date_field

class tdw_catalog.metadata_template.date_field.Field(key: str, default_value: date | None, optional: bool | None)[source]

Bases: MetadataTemplateField[date]

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

Attributes

None

decimal

class tdw_catalog.metadata_template.decimal.Field(key: str, default_value: float | None, optional: bool | None)[source]

Bases: MetadataTemplateField[float]

A field for confidence values or other fractional information

Attributes

None

license_expiry

class tdw_catalog.metadata_template.license_expiry.Field(key: str, default_value: date | None, optional: bool | None)[source]

Bases: RecommendedTemplateMetadataField[date], Field

Monitor data license term limtis

Attributes

None

linked_dataset

class tdw_catalog.metadata_template.linked_dataset.Field(key: str, default_value: Dataset | None, optional: bool | None)[source]

Bases: MetadataTemplateField[Dataset]

Connect Datasets together to indicate a semantic relation and/or increase discoverability

Attributes

None

list

class tdw_catalog.metadata_template.list_field.Field(key: str, default_value: T | None, optional: bool | None, allow_any: bool | None, list_items: List[str] | None)[source]

Bases: MetadataTemplateField[str]

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

Attributes

allow_anyOptional[bool]

An optional boolean switch to determine if values not in the list can be entered

list_itemsOptional[List[str]]

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

creation_builder

class tdw_catalog.metadata_template.creation_builder.MetadataTemplateCreationBuilder(client: Catalog, template: MetadataTemplate)[source]

Bases: object

A MetadataTemplateCreationBuilder assists with the creation of MetadataTemplates

alias_field(key: str, default_value: str | None = None, optional=False) MetadataTemplateCreationBuilder[source]

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

Parameters

keystr

An identifying key for the this field

default_valueOptional[str]

An optional default str value for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

attachment_field(key: str, optional=False) MetadataTemplateCreationBuilder[source]

Attach any metadata files directly to a Dataset

Parameters

keystr

An identifying key for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

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

Parameters

default_valueOptional[Team]

An optional Team object representing a team in this Organization

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

currency_field(key: str, currency: str | None = None, amount: float | None = None, optional=False) MetadataTemplateCreationBuilder[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 default fractional amount of currency for this currency field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

Track and report on the Dataset 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 default fractional amount of currency for this currency field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

date_field(key: str, default_value: date | None = None, optional=False) MetadataTemplateCreationBuilder[source]

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

Parameters

keystr

An identifying key for this field

default_valueOptional[date]

An optional default date value for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

decimal_field(key: str, default_value: float | None = None, optional=False) MetadataTemplateCreationBuilder[source]

A field for confidence values or other fractional information

Parameters

keystr

An identifying key for this field

default_valueOptional[float]

An optional default float value for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

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

Parameters

default_valueOptional[date]

An optional date value that this field represents

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

Any links, urls, or websites associated with a Dataset

Parameters

keystr

An identifying key for this field

default_valueOptional[str]

An optional default str value for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

linked_dataset_field(key: str, default_value: dataset.Dataset | None = None, optional=False) MetadataTemplateCreationBuilder[source]

Associate Datasets with one another to indicate a semantic relation and/or increase discoverability.

Parameters

keystr

An identifying key for this field

default_valueOptional[Dataset]

An optional default Dataset value for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

list_field(key: str, default_value: str | None = None, allow_any: bool | None = True, list_items: List[str] | None = None, optional=False) MetadataTemplateCreationBuilder[source]

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

Parameters

keystr

An identifying key for this field

default_valueOptional[str]

An optional default str value for this field. Must correspond to a value within list_items unless allow_any == True

allow_anyOptional[bool]

An optional boolean switch to determine if values not in the list can be entered

list_itemsOptional[List[str]]

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

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

number_field(key: str, default_value: int | None = None, optional=False) MetadataTemplateCreationBuilder[source]

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

Parameters

keystr

An identifying key for this field

default_valueOptional[int]

An optional default int value for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

organization_member_field(key: str, default_value: OrganizationMember | None = None, optional=False) MetadataTemplateCreationBuilder[source]

Someone who is associated with a Dataset

Parameters

keystr

An identifying key for this field

default_valueOptional[OrganizationMember]

An optional default OrganizationMember value for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

organization_team_field(key: str, default_value: Team | None = None, optional=False) MetadataTemplateCreationBuilder[source]

A Team who is associated with the Dataset

Parameters

keystr

An identifying key for this field

default_valueOptional[Team]

An optional default Team value for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

point_in_time_field(key: str, default_value: datetime | None = None, optional=False) MetadataTemplateCreationBuilder[source]

A specific time and date associated with the Dataset

Parameters

keystr

An identifying key for this field

default_valueOptional[datetime]

An optional default datetime value for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

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

Parameters

default_value: Optional[OrganizationMember]

An optional OrganizationMember object representing a member of this Organization

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

save() MetadataTemplate[source]

Persist this new MetadataTemplate, saving any changes to its name, description or fields list

Parameters

None

Returns

An updated MetadataTemplate with persisted changes

Raises

CatalogPermissionDeniedException

If the caller is not allowed to update this MetadataTemplate

CatalogNotFoundException

If a MetadataTemplate with this id does not exist

CatalogMalformedException

If the MetadataTemplate name or fields is empty

CatalogAlreadyExistsException

If a MetadataTemplate already exists with the same name

CatalogException

If call to the Catalog server fails

text_field(key: str, default_value: str | None = None, optional=False) MetadataTemplateCreationBuilder[source]

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

Parameters

keystr

An identifying key for the this field

default_valueOptional[str]

An optional default str value for this field

Returns

MetadataTemplateCreationBuilder

Returns this builder for further field creation

field

class tdw_catalog.metadata_template.field.MetadataTemplateField(key: str, default_value: T | None, optional: bool | None)[source]

Bases: Generic[T]

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

Attributes

keystr

A key for this field, which must be unique within a MetadataTemplate.

optionalOptional[bool]

Determines whether a value must be supplied for this MetadataTemplateField when the corresponding MetadataTemplate is applied to a Dataset.

default_valueOptional[T]

An optional default value for MetadataFields produced from this MetadataTemplateField.

class tdw_catalog.metadata_template.field.RecommendedTemplateMetadataField(key: str, default_value: T | None = None, optional=False)[source]

Bases: MetadataTemplateField[T]

update_builder

class tdw_catalog.metadata_template.update_builder.MetadataTemplateUpdateBuilder(client: Catalog, template: metadata_template.MetadataTemplate)[source]

Bases: object

A MetadataTemplateUpdateBuilder assists with the alteration and updating of MetadataTemplates

add_alias_field(key: str, default_value: str | None, optional=False) MetadataTemplateUpdateBuilder[source]

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

Parameters

keystr

An identifying key for the this field

default_valueOptional[str]

An optional default str value for this field

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

add_attachment_field(key: str, optional=False) MetadataTemplateUpdateBuilder[source]

Attach any metadata files directly to a Dataset

Parameters

keystr

An identifying key for this field

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

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

Parameters

default_valueOptional[Team]

An optional Team object representing a team in this Organization

Returns

MetadataTemplateUpdateBuilder

Returns this builder for further template modification

add_currency_field(key: str, currency: str | None, amount: float | None, optional=False) MetadataTemplateUpdateBuilder[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

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

Track and report on a Dataset 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

MetadataTemplateUpdateBuilder

Returns this builder for further template modification

add_date_field(key: str, default_value: date | None, optional=False) MetadataTemplateUpdateBuilder[source]

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

Parameters

keystr

An identifying key for this field

default_valueOptional[date]

An optional default date value for this field

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

add_decimal_field(key: str, default_value: float | None, optional=False) MetadataTemplateUpdateBuilder[source]

A field for confidence values or other fractional information

Parameters

keystr

An identifying key for this field

default_valueOptional[float]

An optional default float value for this field

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

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

Parameters

default_valueOptional[date]

An optional date value that this field represents

Returns

MetadataTemplateUpdateBuilder

Returns this builder for further template modification

Any links, urls, or websites associated with a Dataset

Parameters

keystr

An identifying key for this field

default_valueOptional[str]

An optional default str value for this field

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

add_linked_dataset_field(key: str, default_value: dataset.Dataset | None, optional=False) MetadataTemplateUpdateBuilder[source]

Connect :class:.Dataset`s together to indicate a semantic relation and/or increase discoverability

Parameters

keystr

An identifying key for this field

default_valueOptional[Dataset]

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

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

add_list_field(key: str, default_value: str | None, allow_any: bool | None, list_items: List[str] | None, optional=False) MetadataTemplateUpdateBuilder[source]

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

Parameters

keystr

An identifying key for this field

default_valueOptional[str]

An optional default str value for this field. Must correspond to a value within list_items unless allow_any == True

allow_anyOptional[bool]

An optional boolean switch to determine if values not in the list can be entered

list_itemsOptional[List[str]]

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

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

add_number_field(key: str, default_value: int | None, optional=False) MetadataTemplateUpdateBuilder[source]

Track numbers associated with a Dataset, like total number of allowed Users

Parameters

keystr

An identifying key for this field

default_valueOptional[int]

An optional default int value for this field

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

add_organization_member_field(key: str, default_value: OrganizationMember | None, optional=False) MetadataTemplateUpdateBuilder[source]

Someone who is associated with a Dataset

Parameters

keystr

An identifying key for this field

default_valueOptional[OrganizationMember]

An optional default OrganizationMember value for this field

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

add_organization_team_field(key: str, default_value: Team | None, optional=False) MetadataTemplateUpdateBuilder[source]

A Team who is associated with a Dataset

Parameters

keystr

An identifying key for this field

default_valueOptional[Team]

An optional default Team value for this field

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

add_point_in_time_field(key: str, default_value: datetime | None, optional=False) MetadataTemplateUpdateBuilder[source]

A specific time and date associated with a Dataset

Parameters

keystr

An identifying key for this field

default_valueOptional[datetime]

An optional default datetime value for this field

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

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

Parameters

default_value: Optional[OrganizationMember]

An optional OrganizationMember object representing a member of this Organization

Returns

MetadataTemplateUpdateBuilder

Returns this builder for further template modification

add_text_field(key: str, default_value: str | None, optional=False) MetadataTemplateUpdateBuilder[source]

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

Parameters

keystr

An identifying key for the this field

default_valueOptional[str]

An optional default str value for this field

Returns

MetadataTemplaceUpdateFactory

Returns this builder for further template modification

get_field(key: str, cls: MetadataTemplateField[T] = None) MetadataTemplateField[T][source]

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

Parameters

keystr

The key of the desired field

Returns

MetadataTemplateField[T]

The specificed field whose key matches the provided key

Raises

CatalogNotFoundException

If no MetadataTemplateField with a matching key can be found

keys() List[str][source]

Return a list of keys for each field in this MetadataTemplate‘s fields list

Parameters

None

Returns

List[str]

A list of strings representing the keys for each MetadataTemplateField in the MetadataTemplate

list_fields() List[MetadataTemplateField][source]

Return a list of all the fields currently attached to this MetadataTemplate

Parameters

None

Returns

List[field.MetadataTemplateField]

The list of fields on the MetadataTemplate being updated

remove_field(key: str) MetadataTemplateUpdateBuilder[source]

Remove a field from the fields_list of this MetadataTemplate. Changes will not persist unless the template is saved

Parameters

keystr

The key of the field to be removed

reorder(fields: List[MetadataTemplateField]) MetadataTemplateUpdateBuilder[source]

Reorder the fields list of this MetadataTemplate

Parameters

fieldsList[MetadataTemplateField]

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

Raises

CatalogInvalidArgumentException

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

save() MetadataTemplate[source]

Save the MetadataTemplate under construction inside this MetadataTemplateUpdateBuilder

Parameters

None

Returns

MetadataTemplate

The updated MetadataTemplate with any alterations made to its title, description, or fields list

number

class tdw_catalog.metadata_template.number.Field(key: str, default_value: int | None, optional: bool | None)[source]

Bases: MetadataTemplateField[int]

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

Attributes

None

organization_member

class tdw_catalog.metadata_template.organization_member.Field(key: str, default_value: OrganizationMember | None, optional: bool | None)[source]

Bases: MetadataTemplateField[OrganizationMember]

Someone who is associated with the data

Attributes

None

organization_team

class tdw_catalog.metadata_template.organization_team.Field(key: str, default_value: Team | None, optional: bool | None)[source]

Bases: MetadataTemplateField[Team]

A team who is associated with the data

Attributes

None

point_in_time

class tdw_catalog.metadata_template.point_in_time.Field(key: str, default_value: datetime | None, optional: bool | None)[source]

Bases: MetadataTemplateField[datetime]

A specific time and date associated with the Dataset

Attributes

None

point_of_contact

class tdw_catalog.metadata_template.point_of_contact.Field(key: str, default_value: OrganizationMember | None, optional: bool | None)[source]

Bases: RecommendedTemplateMetadataField[OrganizationMember], Field

Primary person who manages the data license

Attributes

None

text

class tdw_catalog.metadata_template.text.Field(key: str, default_value: str | None, optional: bool | None)[source]

Bases: MetadataTemplateField[str]

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

Attributes

None