tdw_catalog.metadata_template
- class tdw_catalog.metadata_template.MetadataTemplate(client, **kwargs)[source]
Bases:
EntityBase
MetadataTemplate
s encompass a standard set ofMetadataTemplateField
s which can be applied toDataset
s within theCatalog
Attributes
- idstr
The unique ID of the
MetadataTemplate
- organizationOrganization
The
Organization
to which thisMetadataTemplate
belongs- organization_idstr
The unique ID of the
Organization
to which thisMetadataTemplate
belongs- created_bystr
The unique user ID of the
OrganizationMember
who created thisMetadataTemplate
- created_by_memberOrganizationMember
The
OrganizationMember
who created thisMetadataTemplate
- titlestr
A title for this
MetadataTemplate
- descriptionOptional[str]
An optional description of this
MetadataTemplate
- fields: List[MetadataTemplateField]
This list of
MetadataTemplateField
s constitutes the fields which would be attached to aDataset
if thisMetadataTemplate
was assigned to theDataset
- 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 theOrganization
.Dataset
s 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 thisOrganization
Parameters
- clientCatalog
The
Catalog
client of theOrganization
containing theMetadataTemplate
- 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 theOrganization
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 theOrganization
matching the ID of the updatedMetadataTemplate
- 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
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 eventsAttributes
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
link
- class tdw_catalog.metadata_template.link.Field(key: str, default_value: str | None, optional: bool | None)[source]
Bases:
MetadataTemplateField
[str
]Any links, urls, or websites associated with the data
Attributes
None
linked_dataset
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 ofMetadataTemplate
s- alias_field(key: str, default_value: str | None = None, optional=False) MetadataTemplateCreationBuilder [source]
An alternative unique identifier for this
Dataset
, for integrating with external systemsParameters
- 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
- contract_owner_recommended_field(default_value: Team | None = None, optional=False) MetadataTemplateCreationBuilder [source]
Team or department that owns the
Dataset
license. The key of this field will automatically be setParameters
- default_valueOptional[Team]
An optional
Team
object representing a team in thisOrganization
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
- data_cost_recommended_field(currency: str | None = None, amount: float | None = None, optional=False) MetadataTemplateCreationBuilder [source]
Track and report on the
Dataset
license cost. The key of this field will automatically be setParameters
- 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 eventsParameters
- 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
- license_expiry_recommended_field(default_value: date | None = None, optional=False) MetadataTemplateCreationBuilder [source]
Monitor
Dataset
license term limits. The key of this field will automatically be setParameters
- default_valueOptional[date]
An optional date value that this field represents
Returns
- MetadataTemplateCreationBuilder
Returns this builder for further field creation
- link_field(key: str, default_value: str | None = None, optional=False) MetadataTemplateCreationBuilder [source]
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
Dataset
s 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 allowedUser
sParameters
- 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 theDataset
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
- point_of_contact_recommended_field(default_value: OrganizationMember | None = None, optional=False) MetadataTemplateCreationBuilder [source]
Primary person who manages the
Dataset
license. The key of this field will automatically be setParameters
- default_value: Optional[OrganizationMember]
An optional
OrganizationMember
object representing a member of thisOrganization
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 listParameters
None
Returns
An updated
MetadataTemplate
with persisted changesRaises
- 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 correspondingMetadataTemplate
is applied to aDataset
.- default_valueOptional[T]
An optional default value for
MetadataField
s produced from thisMetadataTemplateField
.
- 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 ofMetadataTemplate
s- add_alias_field(key: str, default_value: str | None, optional=False) MetadataTemplateUpdateBuilder [source]
An alternative unique identifier for this
Dataset
, for integrating with external systemsParameters
- 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
- add_contract_owner_recommended_field(default_value: Team | None, optional=False) MetadataTemplateUpdateBuilder [source]
Team or department that owns the
Dataset
license. The key of this field will automatically be setParameters
- default_valueOptional[Team]
An optional
Team
object representing a team in thisOrganization
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
- add_data_cost_recommended_field(currency: str | None, amount: float | None, optional=False) MetadataTemplateUpdateBuilder [source]
Track and report on a
Dataset
license cost. The key of this field will automatically be setParameters
- 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 eventsParameters
- 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
- add_license_expiry_recommended_field(default_value: date | None, optional=False) MetadataTemplateUpdateBuilder [source]
Monitor
Dataset
license term limits. The key of this field will automatically be setParameters
- default_valueOptional[date]
An optional date value that this field represents
Returns
- MetadataTemplateUpdateBuilder
Returns this builder for further template modification
- add_link_field(key: str, default_value: str | None, optional=False) MetadataTemplateUpdateBuilder [source]
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 thisMetadataTemplate
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 allowedUser
sParameters
- 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 aDataset
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
- add_point_of_contact_recommended_field(default_value: OrganizationMember | None, optional=False) MetadataTemplateUpdateBuilder [source]
Primary person who manages the
Dataset
license. The key of this field will automatically be setParameters
- default_value: Optional[OrganizationMember]
An optional
OrganizationMember
object representing a member of thisOrganization
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 directlyParameters
- 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 listParameters
None
Returns
- List[str]
A list of strings representing the keys for each
MetadataTemplateField
in theMetadataTemplate
- 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 savedParameters
- 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
MetadataTemplateField
s 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
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 theMetadataTemplate
, or if a provided field matches the key of a field on theMetadataTemplate
but is of a different type
- save() MetadataTemplate [source]
Save the
MetadataTemplate
under construction inside thisMetadataTemplateUpdateBuilder
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 usersAttributes
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
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