Projects¶
Attribute Configurations¶
Attribute Configuration¶
-
class
tamr_unify_client.project.attribute_configuration.resource.
AttributeConfiguration
(client, data, alias=None)[source]¶ The configurations of Tamr Attributes.
See https://docs.tamr.com/reference#the-attribute-configuration-object
-
spec
()[source]¶ Returns this attribute configuration’s spec.
- Returns
The spec of this attribute configuration.
- 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
-
Attribute Configuration Spec¶
-
class
tamr_unify_client.project.attribute_configuration.resource.
AttributeConfigurationSpec
(client, data, api_path)[source]¶ A representation of the server view of an attribute configuration.
-
static
of
(resource)[source]¶ Creates an attribute configuration spec from an attribute configuration.
- Parameters
resource (
AttributeConfiguration
) – The existing attribute configuration.- Returns
The corresponding attribute creation spec.
- Return type
-
static
new
()[source]¶ Creates a blank spec that could be used to construct a new attribute configuration.
- 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_attribute_role
(new_attribute_role)[source]¶ Creates a new spec with the same properties, updating attribute role.
- Parameters
new_attribute_role (str) – The new attribute role.
- Returns
A new spec.
- Return type
-
with_similarity_function
(new_similarity_function)[source]¶ Creates a new spec with the same properties, updating similarity function.
- Parameters
new_similarity_function (str) – The new similarity function.
- Returns
A new spec.
- Return type
-
with_enabled_for_ml
(new_enabled_for_ml)[source]¶ Creates a new spec with the same properties, updating enabled for ML.
- Parameters
new_enabled_for_ml (bool) – Whether the builder is enabled for ML.
- Returns
A new spec.
- Return type
-
with_tokenizer
(new_tokenizer)[source]¶ Creates a new spec with the same properties, updating tokenizer.
- Parameters
new_tokenizer (str) – The new tokenizer.
- Returns
A new spec.
- Return type
-
with_numeric_field_resolution
(new_numeric_field_resolution)[source]¶ Creates a new spec with the same properties, updating numeric field resolution.
- Parameters
new_numeric_field_resolution (str) – The new numeric field resolution.
- Returns
A new spec.
- Return type
-
with_attribute_name
(new_attribute_name)[source]¶ Creates a new spec with the same properties, updating new attribute name.
- Parameters
new_attribute_name (str) – The new attribute name.
- Returns
A new spec.
- Return type
-
static
Attribute Configuration Collection¶
-
class
tamr_unify_client.project.attribute_configuration.collection.
AttributeConfigurationCollection
(client, api_path)[source]¶ Collection of
AttributeConfiguration
- Parameters
-
by_resource_id
(resource_id)[source]¶ Retrieve an attribute configuration by resource ID.
- Parameters
resource_id (str) – The resource ID.
- Returns
The specified attribute configuration.
- Return type
-
by_relative_id
(relative_id)[source]¶ Retrieve an attribute configuration by relative ID.
- Parameters
relative_id (str) – The relative ID.
- Returns
The specified attribute configuration.
- Return type
-
by_external_id
(external_id)[source]¶ Retrieve an attribute configuration 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
NotImplementedError – AttributeConfiguration does not support external_id
-
stream
()[source]¶ Stream attribute configurations in this collection. Implicitly called when iterating over this collection.
- Returns
Stream of attribute configurations.
- Return type
Python generator yielding
AttributeConfiguration
- Usage:
>>> for attributeConfiguration in collection.stream(): # explicit >>> do_stuff(attributeConfiguration) >>> for attributeConfiguration in collection: # implicit >>> do_stuff(attributeConfiguration)
-
create
(creation_spec)[source]¶ Create an Attribute configuration in this collection
- Parameters
creation_spec (dict[str, str]) – Attribute configuration creation specification should be formatted as specified in the Public Docs for adding an AttributeConfiguration.
- Returns
The created Attribute configuration
- Return type
Attribute Mappings¶
Attribute Mapping¶
-
class
tamr_unify_client.project.attribute_mapping.resource.
AttributeMapping
(client, data)[source]¶ see https://docs.tamr.com/reference#retrieve-projects-mappings AttributeMapping and AttributeMappingCollection do not inherit from BaseResource and BaseCollection. BC and BR require a specific URL for each individual attribute mapping (ex: /projects/1/attributeMappings/1), but these types of URLs do not exist for attribute mappings
-
spec
()[source]¶ Returns a spec representation of this attribute mapping.
- Returns
The attribute mapping spec.
- Return type
-
Attribute Mapping Spec¶
-
class
tamr_unify_client.project.attribute_mapping.resource.
AttributeMappingSpec
(data)[source]¶ A representation of the server view of an attribute mapping
-
static
of
(resource)[source]¶ Creates an attribute mapping spec from a attribute mapping.
- Parameters
resource (
AttributeMapping
) – The existing attribute mapping.- Returns
The corresponding attribute mapping spec.
- Return type
-
static
new
()[source]¶ Creates a blank spec that could be used to construct a new attribute mapping.
- 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_input_attribute_id
(new_input_attribute_id)[source]¶ Creates a new spec with the same properties, updating the input attribute id.
- Parameters
new_input_attribute_id (str) – The new input attribute id.
- Returns
The new spec.
- Return type
-
with_relative_input_attribute_id
(new_relative_input_attribute_id)[source]¶ Creates a new spec with the same properties, updating the relative input attribute id.
- Parameters
new_relative_input_attribute_id (str) – The new relative input attribute Id.
- Returns
The new spec.
- Return type
-
with_input_dataset_name
(new_input_dataset_name)[source]¶ Creates a new spec with the same properties, updating the input dataset name.
- Parameters
new_input_dataset_name (str) – The new input dataset name.
- Returns
The new spec.
- Return type
-
with_input_attribute_name
(new_input_attribute_name)[source]¶ Creates a new spec with the same properties, updating the input attribute name.
- Parameters
new_input_attribute_name (str) – The new input attribute name.
- Returns
The new spec.
- Return type
-
with_unified_attribute_id
(new_unified_attribute_id)[source]¶ Creates a new spec with the same properties, updating the unified attribute id.
- Parameters
new_unified_attribute_id (str) – The new unified attribute id.
- Returns
The new spec.
- Return type
-
with_relative_unified_attribute_id
(new_relative_unified_attribute_id)[source]¶ Creates a new spec with the same properties, updating the relative unified attribute id.
- Parameters
new_relative_unified_attribute_id (str) – The new relative unified attribute id.
- Returns
The new spec.
- Return type
-
with_unified_dataset_name
(new_unified_dataset_name)[source]¶ Creates a new spec with the same properties, updating the unified dataset name.
- Parameters
new_unified_dataset_name (str) – The new unified dataset name.
- Returns
The new spec.
- Return type
-
static
Attribute Mapping Collection¶
-
class
tamr_unify_client.project.attribute_mapping.collection.
AttributeMappingCollection
(client, api_path)[source]¶ Collection of
AttributeMapping
- Parameters
-
stream
()[source]¶ Stream attribute mappings in this collection. Implicitly called when iterating over this collection.
- Returns
Stream of attribute mappings.
- Return type
Python generator yielding
AttributeMapping
-
by_resource_id
(resource_id)[source]¶ Retrieve an item in this collection by resource ID.
- Parameters
resource_id (str) – The resource ID.
- Returns
The specified attribute mapping.
- Return type
-
by_relative_id
(relative_id)[source]¶ Retrieve an item in this collection by relative ID.
- Parameters
relative_id (str) – The relative ID.
- Returns
The specified attribute mapping.
- Return type
-
create
(creation_spec)[source]¶ Create an Attribute mapping in this collection
- Parameters
creation_spec (dict[str, str]) – Attribute mapping creation specification should be formatted as specified in the Public Docs for adding an AttributeMapping.
- Returns
The created Attribute mapping
- Return type
Project¶
-
class
tamr_unify_client.project.resource.
Project
(client, data, alias=None)[source]¶ A Tamr project.
-
property
type
¶ A Tamr project type, listed in https://docs.tamr.com/reference#create-a-project.
- Type
-
property
attributes
¶ Attributes of this project.
- Returns
Attributes of this project.
- Return type
-
unified_dataset
()[source]¶ Unified dataset for this project.
- Returns
Unified dataset for this project.
- Return type
-
as_categorization
()[source]¶ Convert this project to a
CategorizationProject
-
as_mastering
()[source]¶ Convert this project to a
MasteringProject
- Returns
This project.
- Return type
- Raises
-
add_input_dataset
(dataset)[source]¶ Associate a dataset with a project in Tamr.
By default, datasets are not associated with any projects. They need to be added as input to a project before they can be used as part of that project
- Parameters
dataset (
Dataset
) – The dataset to associate with the project.- Returns
HTTP response from the server
- Return type
-
remove_input_dataset
(dataset)[source]¶ Remove a dataset from a project.
- Parameters
dataset (
Dataset
) – The dataset to be removed from this project.- Returns
HTTP response from the server
- Return type
-
input_datasets
()[source]¶ Retrieve a collection of this project’s input datasets.
- Returns
The project’s input datasets.
- Return type
-
attribute_configurations
()[source]¶ Project’s attribute’s configurations.
- Returns
The configurations of the attributes of a project.
- Return type
-
attribute_mappings
()[source]¶ Project’s attribute’s mappings.
- Returns
The attribute mappings of a project.
- 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
Project Spec¶
-
class
tamr_unify_client.project.resource.
ProjectSpec
(client, data, api_path)[source]¶ A representation of the server view of a project.
-
static
of
(resource)[source]¶ Creates a project spec from a project.
- Parameters
resource (
Project
) – The existing project.- Returns
The corresponding project spec.
- Return type
-
static
new
()[source]¶ Creates a blank spec that could be used to construct a new project.
- 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 (str) – The new type.
- Returns
The new spec.
- Return type
-
with_external_id
(new_external_id)[source]¶ Creates a new spec with the same properties, updating external ID.
- Parameters
new_external_id (str) – The new external ID.
- Returns
The new spec.
- Return type
-
static
Project Collection¶
-
class
tamr_unify_client.project.collection.
ProjectCollection
(client, api_path='projects')[source]¶ Collection of
Project
s.- Parameters
-
by_external_id
(external_id)[source]¶ Retrieve a project by external ID.
- Parameters
external_id (str) – The external ID.
- Returns
The specified project, if found.
- Return type
- Raises
KeyError – If no project with the specified external_id is found
LookupError – If multiple projects with the specified external_id are found
-
stream
()[source]¶ Stream projects in this collection. Implicitly called when iterating over this collection.
- Returns
Stream of projects.
- Return type
Python generator yielding
Project
- Usage:
>>> for project in collection.stream(): # explicit >>> do_stuff(project) >>> for project in collection: # implicit >>> do_stuff(project)
-
by_name
(project_name)[source]¶ Get project by name
Fetches a specific project in this collection by exact-match on name.
-
create
(creation_spec)[source]¶ Create a Project in Tamr
- Parameters
creation_spec (dict[str, str]) – Project creation specification should be formatted as specified in the Public Docs for Creating a Project.
- Returns
The created Project
- Return type
Project Step¶
-
class
tamr_unify_client.project.step.
ProjectStep
(client, data)[source]¶ A step of a Tamr project. This is not a BaseResource because it has no API path and cannot be directly retrieved or modified.
See https://docs.tamr.com/reference#retrieve-downstream-dataset-usage
- Parameters
-
property
type
¶ A Tamr project type, listed in https://docs.tamr.com/reference#create-a-project.
- Type