from tamr_unify_client import Client
from tamr_unify_client.auth import UsernamePasswordAuth
import os
# grab credentials from environment variables
username = os.environ['TAMR_USERNAME']
password = os.environ['TAMR_PASSWORD']
auth = UsernamePasswordAuth(username, password)
host = 'localhost' # replace with your Tamr host
tamr = Client(auth, host=host)
# programmatically interact with Tamr!
# e.g. refresh your project's Unified Dataset
project = tamr.projects.by_resource_id('3')
ud = project.unified_dataset()
op = ud.refresh()
assert op.succeeded()