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
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],FieldTrack 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
Datasetto keep track of timelines or eventsAttributes
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],FieldMonitor data license term limits
Attributes
None
link
- class tdw_catalog.metadata.link.Field(key: str, value: str | None)[source]
Bases:
MetadataField[str]Any links, urls, or websites associated with the data
Attributes
None
linked_dataset
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
DatasetAttributes
- 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:
TemplatedMetadataEditorA
MetadataEditorassists with the alteration and updating ofMetadataFields in aDataset- add_alias_field(key: str, value: str | None) MetadataEditor[source]
An alternative unique identifier for this
Dataset, for integrating with external systemsParameters
- keystr
An identifying key for the this field
- valueOptional[str]
An optional str value for the alias this field represents
Returns
- MetadataEditor
Returns this
MetadataEditorfor further metadata editing
- add_attachment_field(key: str, value: str) MetadataEditor[source]
Attach any metadata files directly to the
DatasetParameters
- keystr
A path for the file to be attached with this field
Returns
- MetadataEditor
Returns this
MetadataEditorfor further metadata editing
Raises
- CatalogInternalException
If the call to the
Catalogserver fails when uploading the file to be attached
- add_contract_owner_recommended_field(value: Team | None) MetadataEditor[source]
Team or department that owns the data license. The key of this field will automatically be set
Parameters
- valueOptional[Team]
An optional
Teamobject representing a team in thisOrganization
Returns
- MetadataEditor
Returns this
MetadataEditorfor further metadata editing
Raises
- CatalogFailedPreconditionException
If the
Datasetalready 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
MetadataEditorfor further metadata editing
- add_data_cost_recommended_field(currency: str | None, amount: float | None) MetadataEditor[source]
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
MetadataEditorfor further metadata editing
Raises
- CatalogFailedPreconditionException
If the
Datasetalready has an attached data cost field, templated or not
- add_date_field(key: str, value: date | None) MetadataEditor[source]
Add dates to the
Datasetto keep track of timelines or eventsParameters
- keystr
An identifying key for this field
- valueOptional[date]
An optional date object for the date this field represents
Returns
- MetadataEditor
Returns this
MetadataEditorfor 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
MetadataEditorfor further metadata editing
- add_license_expiry_recommended_field(value: date | None) MetadataEditor[source]
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
MetadataEditorfor further metadata editing
Raises
- CatalogFailedPreconditionException
If the
Datasetalready has an attached license expiry field, templated or not
- add_link_field(key: str, value: str | None) MetadataEditor[source]
Any links, urls, or websites associated with the
DatasetParameters
- keystr
An identifying key for this field
- valueOptional[str]
An optional str value for the url this field represents
Returns
- MetadataEditor
Returns this
MetadataEditorfor further metadata editing
- add_linked_dataset_field(key: str, value: Dataset | None) MetadataEditor[source]
Connect
Datasets together to maintain lineage or increase discoverabilityParameters
- keystr
An identifying key for this field
- valueOptional[Dataset]
An optional object representing a
Datasetthat has been semantically linked to this field
Returns
- MetadataEditor
Returns this
MetadataEditorfor further metadata editing
- add_number_field(key: str, value: int | None) MetadataEditor[source]
Track numbers associated with the
Dataset, like total number of allowed usersParameters
- keystr
An identifying key for this field
- valueOptional[int]
An optional int value for the number this field represents
Returns
- MetadataEditor
Returns this
MetadataEditorfor 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
OrganizationMembervalue representing a member of thisDataset’sOrganization
Returns
- MetadataEditor
Returns this
MetadataEditorfor further metadata editing
- add_organization_team_field(key: str, value: Team | None) MetadataEditor[source]
A
Teamwho is associated with the dataParameters
- keystr
An identifying key for this field
- valueOptional[Team]
An optional
Teamvalue representing a team in thisDataset’sOrganization
Returns
- MetadataEditor
Returns this
MetadataEditorfor further metadata editing
- add_point_in_time_field(key: str, value: datetime | None) MetadataEditor[source]
A specific time and date associated with the
DatasetParameters
- keystr
An identifying key for this field
- valueOptional[datetime]
An optional datetime value for the datetime this field represents
Returns
- MetadataEditor
Returns this
MetadataEditorfor further metadata editing
- add_point_of_contact_recommended_field(value: OrganizationMember | None) MetadataEditor[source]
Primary person who manages the data license. The key of this field will automatically be set
Parameters
- value: Optional[OrganizationMember]
An optional
OrganizationMemberobject representing a member of thisOrganization
Returns
- MetadataEditor
Returns this
MetadataEditorfor further metadata editing
Raises
- CatalogFailedPreconditionException
If the
Datasetalready 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
DatasetParameters
- keystr
An identifying key for the this field
- valueOptional[str]
An optional str value for the text this field represents
Returns
- MetadataEditor
Returns this
MetadataEditorfor further metadata editing
- remove_field(key: str) MetadataEditor[source]
Remove a metadata field from the
DatasetParameters
- keystr
The key of the field to be removed
Returns
- MetadataEditor
This
MetadataEditorwith the given field removed from its fields list
- reorder(new_field_order: List[MetadataField]) MetadataEditor[source]
Reorder the fields list of this
MetadataEditorParameters
- new_field_orderList[MetadataField]
The newly ordered list of
MetadataTemplateFields to replace the old list on thisMetadataTemplate. Must contain the same fields as the original list, with the only allowed change being the list’s order
Returns
- MetadataEditor
This
MetadataEditorwith 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 theDataset, 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:
objectA
TemplatedMetadataEditorassists with the alteration and updating ofMetadataFieldvalues in aDataset- 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 directlyParameters
- 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
MetadataFieldwith 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 listParameters
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
MetadataEditorParameters
None
Returns
- List[MetadataField]
The list of
MetadataFields currently being edited by thisMetadataEditor
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
DatasetAttributes
- 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 thisMetadataField.
- class tdw_catalog.metadata.field.RecommendedMetadataField(key: str, value: T)[source]
Bases:
MetadataField[T]A subclass of
MetadataFieldrepresenting one of license expiry, point of contact, data cost, or contract owner. The key of aRecommendedMetadataFieldcannot be changed
- class tdw_catalog.metadata.field.TemplatedMetadataField(field: MetadataField[T])[source]
Bases:
Generic[T]A wrapper class for
MetadataFields that come from an attachedMetadataTemplate.TemplatedMetadataFields keys can not be changed on aDataset.
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 usersAttributes
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
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
DatasetAttributes
None
point_of_contact
- class tdw_catalog.metadata.point_of_contact.Field(key: str, value: OrganizationMember | None)[source]
Bases:
RecommendedMetadataField[OrganizationMember],FieldPrimary 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
DatasetAttributes
None