Attributes¶
Attribute¶
-
class
tamr_unify_client.attribute.resource.
Attribute
(client, data, alias=None)[source]¶ A Tamr Attribute.
See https://docs.tamr.com/reference#attribute-types
-
property
type
¶ - Type
-
spec
()[source]¶ Returns a spec representation of this attribute.
- Returns
The attribute spec.
- Return type
-
delete
()¶ Deletes this resource. Some resources do not support deletion, and will raise a 405 error if this is called.
- Returns
HTTP response from the server
- Return type
-
property
Attribute Spec¶
-
class
tamr_unify_client.attribute.resource.
AttributeSpec
(client, data, api_path)[source]¶ A representation of the server view of an attribute
-
static
of
(resource)[source]¶ Creates an attribute spec from an attribute.
- Parameters
resource (
Attribute
) – The existing attribute.- Returns
The corresponding attribute spec.
- Return type
-
static
new
()[source]¶ Creates a blank spec that could be used to construct a new attribute.
- Returns
The empty spec.
- Return type
-
from_data
(data)[source]¶ Creates a spec with the same client and API path as this one, but new data.
- Parameters
data (dict) – The data for the new spec.
- Returns
The new spec.
- Return type
-
to_dict
()[source]¶ Returns a version of this spec that conforms to the API representation.
- Returns
The spec’s dict.
- Return type
-
with_name
(new_name)[source]¶ Creates a new spec with the same properties, updating name.
- Parameters
new_name (str) – The new name.
- Returns
The new spec.
- Return type
-
with_description
(new_description)[source]¶ Creates a new spec with the same properties, updating description.
- Parameters
new_description (str) – The new description.
- Returns
The new spec.
- Return type
-
with_type
(new_type)[source]¶ Creates a new spec with the same properties, updating type.
- Parameters
new_type (
AttributeTypeSpec
) – The spec of the new type.- Returns
The new spec.
- Return type
-
static
Attribute Collection¶
-
class
tamr_unify_client.attribute.collection.
AttributeCollection
(client, api_path)[source]¶ Collection of
Attribute
s.- Parameters
-
by_external_id
(external_id)[source]¶ Retrieve an attribute by external ID.
Since attributes do not have external IDs, this method is not supported and will raise a
NotImplementedError
.- Parameters
external_id (str) – The external ID.
- Returns
The specified attribute, if found.
- Return type
- Raises
KeyError – If no attribute with the specified external_id is found
LookupError – If multiple attributes with the specified external_id are found
-
stream
()[source]¶ Stream attributes in this collection. Implicitly called when iterating over this collection.
- Returns
Stream of attributes.
- Return type
Python generator yielding
Attribute
- Usage:
>>> for attribute in collection.stream(): # explicit >>> do_stuff(attribute) >>> for attribute in collection: # implicit >>> do_stuff(attribute)
-
by_name
(attribute_name)[source]¶ Lookup a specific attribute in this collection by exact-match on name.
-
create
(creation_spec)[source]¶ Create an Attribute in this collection
- Parameters
creation_spec (dict[str, str]) – Attribute creation specification should be formatted as specified in the Public Docs for adding an Attribute.
- Returns
The created Attribute
- Return type
Attribute Type¶
-
class
tamr_unify_client.attribute.type.
AttributeType
(data)[source]¶ The type of an
Attribute
orSubAttribute
.See https://docs.tamr.com/reference#attribute-types
- Parameters
data (
dict
) – JSON data representing this type
-
property
inner_type
¶ - Type
-
property
attributes
¶ - Type
list[
SubAttribute
]
Attribute Type Spec¶
-
class
tamr_unify_client.attribute.type.
AttributeTypeSpec
(data)[source]¶ -
static
of
(resource)[source]¶ Creates an attribute type spec from an attribute type.
- Parameters
resource (
AttributeType
) – The existing attribute type.- Returns
The corresponding attribute type spec.
- Return type
-
static
new
()[source]¶ Creates a blank spec that could be used to construct a new attribute type.
- Returns
The empty spec.
- Return type
-
to_dict
()[source]¶ Returns a version of this spec that conforms to the API representation.
- Returns
The spec’s dict.
- Return type
-
with_base_type
(new_base_type)[source]¶ Creates a new spec with the same properties, updating the base type.
- Parameters
new_base_type (str) – The new base type.
- Returns
The new spec.
- Return type
-
with_inner_type
(new_inner_type)[source]¶ Creates a new spec with the same properties, updating the inner type.
- Parameters
new_inner_type (
AttributeTypeSpec
) – The spec of the new inner type.- Returns
The new spec.
- Return type
-
with_attributes
(new_attributes)[source]¶ Creates a new spec with the same properties, updating attributes.
- Parameters
new_attributes (list[
AttributeSpec
]) – The specs of the new attributes.- Returns
The new spec.
- Return type
-
static
SubAttribute¶
-
class
tamr_unify_client.attribute.subattribute.
SubAttribute
(name, type, is_nullable, _json, description=None)[source]¶ An attribute which is itself a property of another attribute.
See https://docs.tamr.com/reference#attribute-types
- Parameters
name (
str
) – Name of sub-attributetype (
AttributeType
) – See https://docs.tamr.com/reference#attribute-typesis_nullable (
bool
) – If this sub-attribute can be null