Client¶
-
class
tamr_unify_client.
Client
(auth, host='localhost', protocol='http', port=9100, base_path='/api/versioned/v1/', session=None)[source]¶ Python Client for Tamr API.
Each client is specific to a specific origin (protocol, host, port).
- Parameters
auth (
AuthBase
) –Tamr-compatible Authentication provider.
Recommended: use one of the classes described in Authentication
host (
str
) – Host address of remote Tamr instance (e.g.'10.0.10.0'
)protocol (
str
) – Either'http'
or'https'
port (
int
) – Tamr instance main portbase_path (
str
) – Base API path. Requests made by this client will be relative to this path.session (
Optional
[Session
]) – Session to use for API calls. If none is provided, will use a newrequests.Session
.
Example
>>> from tamr_unify_client import Client >>> from tamr_unify_client.auth import UsernamePasswordAuth >>> auth = UsernamePasswordAuth('my username', 'my password') >>> tamr_local = Client(auth) # on http://localhost:9100 >>> tamr_remote = Client(auth, protocol='https', host='10.0.10.0') # on https://10.0.10.0:9100
-
property
origin
¶ HTTP origin i.e.
<protocol>://<host>[:<port>]
.For additional information, see MDN web docs .
- Return type
-
request
(method, endpoint, **kwargs)[source]¶ Sends a request to Tamr.
The URL for the request will be
<origin>/<base_path>/<endpoint>
. The request is authenticated viaClient.auth
.
-
property
projects
¶ Collection of all projects on this Tamr instance.
- Return type
- Returns
Collection of all projects.
-
property
datasets
¶ Collection of all datasets on this Tamr instance.
- Return type
- Returns
Collection of all datasets.