dtool_lookup_api.core.LookupClient

dtool_lookup_api.core.LookupClient module.

Functions

deprecated([replacement])

Marks a function or method a deprecated and hints to a possible replacement.

Classes

ConfigurationBasedLookupClient([lookup_url, ...])

Use configured token if available and valid or reuest new token with credentials if provided.

CredentialsBasedLookupClient(lookup_url, ...)

Request new token for every session based on user credentials.

LookupClient(lookup_url, auth_url, username, ...)

Deprecated, for compatibility reasons only.

TokenBasedLookupClient(lookup_url[, token, ...])

Core Python interface for communication with dserver.

Exceptions

LookupServerError

dtool_lookup_api.core.LookupClient.deprecated(replacement=None)[source]

Marks a function or method a deprecated and hints to a possible replacement.

exception dtool_lookup_api.core.LookupClient.LookupServerError[source]

Bases: Exception

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class dtool_lookup_api.core.LookupClient.TokenBasedLookupClient(lookup_url, token=None, verify_ssl=True)[source]

Bases: object

Core Python interface for communication with dserver.

__init__(lookup_url, token=None, verify_ssl=True)[source]
async create_session()[source]
async connect()[source]

Establish connection.

async close()[source]

Close session if open.

property header
async get_config()[source]

Request the server configuration.

async get_versions()[source]

Request versions from the server

async get_datasets(free_text=None, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})[source]

Get dataset entries on lookup server, filtered if desired.

Parameters

free_textstr, optional

select datasets containing this free text

creator_usernames: list of str, optional

select datasets created by any of these specific users

base_uris: list of str, optional

select datasets living on any of these base URIs

uuids: list of str, optional

select datasets matching any of these UUIDs

tags: list of str, optional

select datasets matching all provided tags

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

paginationdict

dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sortingdict

dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

jsonlist of dict

search results

async get_dataset(uri)[source]

Retrieve dataset information by URI.

Parameters

uristr

The unique resource identifier (URI) of the dataset to be retrieved.

Returns

dict

Basic metadata info for dataset at URI.

async delete_dataset(uri)[source]

Delete a dataset using URI. (Needs admin privileges.)

async register_dataset(uri, base_uri, readme, manifest, uuid, name, type, creator_username, frozen_at, created_at, annotations, tags, number_of_items, size_in_bytes)[source]

Register or update a dataset using URI.

async get_datasets_by_uuid(uuid, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})[source]

Search for entries by a specific UUID.

Parameters

uuidstr

The unique identifier (UUID) of the dataset to be searched.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Query results for the specified UUID.

async get_readme(uri)[source]

Request the README.yml of a dataset by URI.

async get_manifest(uri)[source]

Request the manifest of a dataset by URI.

async get_tags(uri)[source]

Request the tags of a dataset by URI.

async get_annotations(uri)[source]

Request the annotations of a dataset by URI.

async get_users(page_number=1, page_size=10, sort_fields=['username'], sort_order=[1], pagination={}, sorting={})[source]

Request a list of users. (Needs admin privileges.)

Parameters

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

User information including username, email, roles, etc.

async get_me()[source]

Request the current user info.

async get_user(username=None)[source]

Request user info.

If no username specified, query currently authenticated user.

async register_user(username, is_admin=False)[source]

Register or update a user. (Needs admin privileges.)

async delete_user(username)[source]

Delete a user. (Needs admin privileges.)

async get_summary(username=None)[source]

Overall summary of datasets accessible to a user.

If no username specified, query currently authenticated user.

async get_my_summary()[source]

Overall summary of datasets accessible to the current user.

async get_base_uris(page_number=1, page_size=10, sort_fields=['base_uri'], sort_order=[1], pagination={}, sorting={})[source]

List all registered base URIs. (Needs admin privileges.)

Parameters

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict
Dictionary filled with data from the X-Sort response header, e.g.

‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Registered base URIs information including name, URI, and description.

async get_base_uri(base_uri)[source]

Request base URI info.

async register_base_uri(base_uri, users_with_search_permissions=[], users_with_register_permissions=[])[source]

Register or update a base URI. (Needs admin privileges.)

async delete_base_uri(base_uri)[source]

Delete a base URI. (Needs admin privileges.)

async get_datasets_by_mongo_aggregation(aggregation, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})[source]

Execute a direct MongoDB aggregation.

Parameters

aggregationstr or dict

The MongoDB aggregation pipeline to be executed.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

Dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Aggregation results.

async get_datasets_by_mongo_query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})[source]

Direct mongo query, requires server-side direct mongo plugin.

Parameters

querystr or dict

The MongoDB query to be executed.

creator_usernames: list of str, optional

Select datasets created by any of these specific users

base_uris: list of str, optional

Select datasets living on any of these base URIs

uuids: list of str, optional

Select datasets matching any of these UUIDs

tags: list of str, optional

Select datasets matching all provided tags

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

Dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

jsonlist of dict

query results

async get_graph_by_uuid(uuid, dependency_keys=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})[source]

Request dependency graph for a specific UUID.

Parameters

uuidstr

The unique identifier of the dataset for which the dependency graph is requested.

dependency_keyslist of str, optional

A list of dependency keys to filter the dependency graph. If not provided, the entire dependency graph will be returned.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Dependency graph results.

config()[source]

Request the server configuration. Deprecated.

versions()[source]

Request versions from the server. Deprecated.

all(page_number=1, page_size=20, pagination={})[source]

List all registered datasets.

search(keyword, page_number=1, page_size=10, pagination={})[source]

Free text search.

Parameters

keywordstr

free text search text

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

Returns

jsonlist of dict

search results

lookup(uuid, page_number=1, page_size=10, pagination={})[source]

Search for entries by a specific UUID.

by_uuid(uuid, page_number=1, page_size=10, pagination={})[source]

Search for entries by a specific UUID.

readme(uri)[source]

Request the README.yml of a dataset by URI. Deprecated.

manifest(uri)[source]

Request the manifest of a dataset by URI. Deprecated.

list_users(page_number=1, page_size=10, pagination={})[source]

Request a list of users. (Needs admin privileges.)

user_info(username)[source]

Request user info. Deprecated.

summary()[source]

Overall summary of datasets accessible to a user.

list_base_uris(page_number=1, page_size=10, pagination={})[source]
aggregate(aggregation, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})[source]
by_query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})[source]

Direct mongo query, requires server-side direct mongo plugin.

query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})[source]
graph(uuid, dependency_keys=None, page_number=1, page_size=10, pagination={})[source]
class dtool_lookup_api.core.LookupClient.CredentialsBasedLookupClient(lookup_url, auth_url, username, password, verify_ssl=True)[source]

Bases: TokenBasedLookupClient

Request new token for every session based on user credentials.

__init__(lookup_url, auth_url, username, password, verify_ssl=True)[source]
async authenticate()[source]

Authenticate against token generator and return received token.

async connect()[source]

Establish connection.

aggregate(aggregation, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})
all(page_number=1, page_size=20, pagination={})

List all registered datasets.

by_query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Direct mongo query, requires server-side direct mongo plugin.

by_uuid(uuid, page_number=1, page_size=10, pagination={})

Search for entries by a specific UUID.

async close()

Close session if open.

config()

Request the server configuration. Deprecated.

async create_session()
async delete_base_uri(base_uri)

Delete a base URI. (Needs admin privileges.)

async delete_dataset(uri)

Delete a dataset using URI. (Needs admin privileges.)

async delete_user(username)

Delete a user. (Needs admin privileges.)

async get_annotations(uri)

Request the annotations of a dataset by URI.

async get_base_uri(base_uri)

Request base URI info.

async get_base_uris(page_number=1, page_size=10, sort_fields=['base_uri'], sort_order=[1], pagination={}, sorting={})

List all registered base URIs. (Needs admin privileges.)

Parameters

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict
Dictionary filled with data from the X-Sort response header, e.g.

‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Registered base URIs information including name, URI, and description.

async get_config()

Request the server configuration.

async get_dataset(uri)

Retrieve dataset information by URI.

Parameters

uristr

The unique resource identifier (URI) of the dataset to be retrieved.

Returns

dict

Basic metadata info for dataset at URI.

async get_datasets(free_text=None, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Get dataset entries on lookup server, filtered if desired.

Parameters

free_textstr, optional

select datasets containing this free text

creator_usernames: list of str, optional

select datasets created by any of these specific users

base_uris: list of str, optional

select datasets living on any of these base URIs

uuids: list of str, optional

select datasets matching any of these UUIDs

tags: list of str, optional

select datasets matching all provided tags

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

paginationdict

dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sortingdict

dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

jsonlist of dict

search results

async get_datasets_by_mongo_aggregation(aggregation, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Execute a direct MongoDB aggregation.

Parameters

aggregationstr or dict

The MongoDB aggregation pipeline to be executed.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

Dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Aggregation results.

async get_datasets_by_mongo_query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Direct mongo query, requires server-side direct mongo plugin.

Parameters

querystr or dict

The MongoDB query to be executed.

creator_usernames: list of str, optional

Select datasets created by any of these specific users

base_uris: list of str, optional

Select datasets living on any of these base URIs

uuids: list of str, optional

Select datasets matching any of these UUIDs

tags: list of str, optional

Select datasets matching all provided tags

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

Dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

jsonlist of dict

query results

async get_datasets_by_uuid(uuid, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Search for entries by a specific UUID.

Parameters

uuidstr

The unique identifier (UUID) of the dataset to be searched.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Query results for the specified UUID.

async get_graph_by_uuid(uuid, dependency_keys=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Request dependency graph for a specific UUID.

Parameters

uuidstr

The unique identifier of the dataset for which the dependency graph is requested.

dependency_keyslist of str, optional

A list of dependency keys to filter the dependency graph. If not provided, the entire dependency graph will be returned.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Dependency graph results.

async get_manifest(uri)

Request the manifest of a dataset by URI.

async get_me()

Request the current user info.

async get_my_summary()

Overall summary of datasets accessible to the current user.

async get_readme(uri)

Request the README.yml of a dataset by URI.

async get_summary(username=None)

Overall summary of datasets accessible to a user.

If no username specified, query currently authenticated user.

async get_tags(uri)

Request the tags of a dataset by URI.

async get_user(username=None)

Request user info.

If no username specified, query currently authenticated user.

async get_users(page_number=1, page_size=10, sort_fields=['username'], sort_order=[1], pagination={}, sorting={})

Request a list of users. (Needs admin privileges.)

Parameters

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

User information including username, email, roles, etc.

async get_versions()

Request versions from the server

graph(uuid, dependency_keys=None, page_number=1, page_size=10, pagination={})
property header
list_base_uris(page_number=1, page_size=10, pagination={})
list_users(page_number=1, page_size=10, pagination={})

Request a list of users. (Needs admin privileges.)

lookup(uuid, page_number=1, page_size=10, pagination={})

Search for entries by a specific UUID.

manifest(uri)

Request the manifest of a dataset by URI. Deprecated.

query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})
readme(uri)

Request the README.yml of a dataset by URI. Deprecated.

async register_base_uri(base_uri, users_with_search_permissions=[], users_with_register_permissions=[])

Register or update a base URI. (Needs admin privileges.)

async register_dataset(uri, base_uri, readme, manifest, uuid, name, type, creator_username, frozen_at, created_at, annotations, tags, number_of_items, size_in_bytes)

Register or update a dataset using URI.

async register_user(username, is_admin=False)

Register or update a user. (Needs admin privileges.)

search(keyword, page_number=1, page_size=10, pagination={})

Free text search.

Parameters

keywordstr

free text search text

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

Returns

jsonlist of dict

search results

summary()

Overall summary of datasets accessible to a user.

user_info(username)

Request user info. Deprecated.

versions()

Request versions from the server. Deprecated.

class dtool_lookup_api.core.LookupClient.ConfigurationBasedLookupClient(lookup_url=None, auth_url=None, username=None, password=None, verify_ssl=None, cache_token=True)[source]

Bases: CredentialsBasedLookupClient

Use configured token if available and valid or reuest new token with credentials if provided.

__init__(lookup_url=None, auth_url=None, username=None, password=None, verify_ssl=None, cache_token=True)[source]
async connect()[source]

Establish connection.

async has_valid_token()[source]

Determine whether token still valid.

aggregate(aggregation, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})
all(page_number=1, page_size=20, pagination={})

List all registered datasets.

async authenticate()

Authenticate against token generator and return received token.

by_query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Direct mongo query, requires server-side direct mongo plugin.

by_uuid(uuid, page_number=1, page_size=10, pagination={})

Search for entries by a specific UUID.

async close()

Close session if open.

config()

Request the server configuration. Deprecated.

async create_session()
async delete_base_uri(base_uri)

Delete a base URI. (Needs admin privileges.)

async delete_dataset(uri)

Delete a dataset using URI. (Needs admin privileges.)

async delete_user(username)

Delete a user. (Needs admin privileges.)

async get_annotations(uri)

Request the annotations of a dataset by URI.

async get_base_uri(base_uri)

Request base URI info.

async get_base_uris(page_number=1, page_size=10, sort_fields=['base_uri'], sort_order=[1], pagination={}, sorting={})

List all registered base URIs. (Needs admin privileges.)

Parameters

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict
Dictionary filled with data from the X-Sort response header, e.g.

‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Registered base URIs information including name, URI, and description.

async get_config()

Request the server configuration.

async get_dataset(uri)

Retrieve dataset information by URI.

Parameters

uristr

The unique resource identifier (URI) of the dataset to be retrieved.

Returns

dict

Basic metadata info for dataset at URI.

async get_datasets(free_text=None, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Get dataset entries on lookup server, filtered if desired.

Parameters

free_textstr, optional

select datasets containing this free text

creator_usernames: list of str, optional

select datasets created by any of these specific users

base_uris: list of str, optional

select datasets living on any of these base URIs

uuids: list of str, optional

select datasets matching any of these UUIDs

tags: list of str, optional

select datasets matching all provided tags

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

paginationdict

dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sortingdict

dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

jsonlist of dict

search results

async get_datasets_by_mongo_aggregation(aggregation, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Execute a direct MongoDB aggregation.

Parameters

aggregationstr or dict

The MongoDB aggregation pipeline to be executed.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

Dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Aggregation results.

async get_datasets_by_mongo_query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Direct mongo query, requires server-side direct mongo plugin.

Parameters

querystr or dict

The MongoDB query to be executed.

creator_usernames: list of str, optional

Select datasets created by any of these specific users

base_uris: list of str, optional

Select datasets living on any of these base URIs

uuids: list of str, optional

Select datasets matching any of these UUIDs

tags: list of str, optional

Select datasets matching all provided tags

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

Dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

jsonlist of dict

query results

async get_datasets_by_uuid(uuid, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Search for entries by a specific UUID.

Parameters

uuidstr

The unique identifier (UUID) of the dataset to be searched.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Query results for the specified UUID.

async get_graph_by_uuid(uuid, dependency_keys=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Request dependency graph for a specific UUID.

Parameters

uuidstr

The unique identifier of the dataset for which the dependency graph is requested.

dependency_keyslist of str, optional

A list of dependency keys to filter the dependency graph. If not provided, the entire dependency graph will be returned.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Dependency graph results.

async get_manifest(uri)

Request the manifest of a dataset by URI.

async get_me()

Request the current user info.

async get_my_summary()

Overall summary of datasets accessible to the current user.

async get_readme(uri)

Request the README.yml of a dataset by URI.

async get_summary(username=None)

Overall summary of datasets accessible to a user.

If no username specified, query currently authenticated user.

async get_tags(uri)

Request the tags of a dataset by URI.

async get_user(username=None)

Request user info.

If no username specified, query currently authenticated user.

async get_users(page_number=1, page_size=10, sort_fields=['username'], sort_order=[1], pagination={}, sorting={})

Request a list of users. (Needs admin privileges.)

Parameters

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

User information including username, email, roles, etc.

async get_versions()

Request versions from the server

graph(uuid, dependency_keys=None, page_number=1, page_size=10, pagination={})
property header
list_base_uris(page_number=1, page_size=10, pagination={})
list_users(page_number=1, page_size=10, pagination={})

Request a list of users. (Needs admin privileges.)

lookup(uuid, page_number=1, page_size=10, pagination={})

Search for entries by a specific UUID.

manifest(uri)

Request the manifest of a dataset by URI. Deprecated.

query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})
readme(uri)

Request the README.yml of a dataset by URI. Deprecated.

async register_base_uri(base_uri, users_with_search_permissions=[], users_with_register_permissions=[])

Register or update a base URI. (Needs admin privileges.)

async register_dataset(uri, base_uri, readme, manifest, uuid, name, type, creator_username, frozen_at, created_at, annotations, tags, number_of_items, size_in_bytes)

Register or update a dataset using URI.

async register_user(username, is_admin=False)

Register or update a user. (Needs admin privileges.)

search(keyword, page_number=1, page_size=10, pagination={})

Free text search.

Parameters

keywordstr

free text search text

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

Returns

jsonlist of dict

search results

summary()

Overall summary of datasets accessible to a user.

user_info(username)

Request user info. Deprecated.

versions()

Request versions from the server. Deprecated.

class dtool_lookup_api.core.LookupClient.LookupClient(lookup_url, auth_url, username, password, verify_ssl=True)[source]

Bases: CredentialsBasedLookupClient

Deprecated, for compatibility reasons only.

__init__(lookup_url, auth_url, username, password, verify_ssl=True)
aggregate(aggregation, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})
all(page_number=1, page_size=20, pagination={})

List all registered datasets.

async authenticate()

Authenticate against token generator and return received token.

by_query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Direct mongo query, requires server-side direct mongo plugin.

by_uuid(uuid, page_number=1, page_size=10, pagination={})

Search for entries by a specific UUID.

async close()

Close session if open.

config()

Request the server configuration. Deprecated.

async connect()

Establish connection.

async create_session()
async delete_base_uri(base_uri)

Delete a base URI. (Needs admin privileges.)

async delete_dataset(uri)

Delete a dataset using URI. (Needs admin privileges.)

async delete_user(username)

Delete a user. (Needs admin privileges.)

async get_annotations(uri)

Request the annotations of a dataset by URI.

async get_base_uri(base_uri)

Request base URI info.

async get_base_uris(page_number=1, page_size=10, sort_fields=['base_uri'], sort_order=[1], pagination={}, sorting={})

List all registered base URIs. (Needs admin privileges.)

Parameters

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict
Dictionary filled with data from the X-Sort response header, e.g.

‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Registered base URIs information including name, URI, and description.

async get_config()

Request the server configuration.

async get_dataset(uri)

Retrieve dataset information by URI.

Parameters

uristr

The unique resource identifier (URI) of the dataset to be retrieved.

Returns

dict

Basic metadata info for dataset at URI.

async get_datasets(free_text=None, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Get dataset entries on lookup server, filtered if desired.

Parameters

free_textstr, optional

select datasets containing this free text

creator_usernames: list of str, optional

select datasets created by any of these specific users

base_uris: list of str, optional

select datasets living on any of these base URIs

uuids: list of str, optional

select datasets matching any of these UUIDs

tags: list of str, optional

select datasets matching all provided tags

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

paginationdict

dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sortingdict

dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

jsonlist of dict

search results

async get_datasets_by_mongo_aggregation(aggregation, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Execute a direct MongoDB aggregation.

Parameters

aggregationstr or dict

The MongoDB aggregation pipeline to be executed.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

Dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Aggregation results.

async get_datasets_by_mongo_query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Direct mongo query, requires server-side direct mongo plugin.

Parameters

querystr or dict

The MongoDB query to be executed.

creator_usernames: list of str, optional

Select datasets created by any of these specific users

base_uris: list of str, optional

Select datasets living on any of these base URIs

uuids: list of str, optional

Select datasets matching any of these UUIDs

tags: list of str, optional

Select datasets matching all provided tags

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

Dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

jsonlist of dict

query results

async get_datasets_by_uuid(uuid, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Search for entries by a specific UUID.

Parameters

uuidstr

The unique identifier (UUID) of the dataset to be searched.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Query results for the specified UUID.

async get_graph_by_uuid(uuid, dependency_keys=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})

Request dependency graph for a specific UUID.

Parameters

uuidstr

The unique identifier of the dataset for which the dependency graph is requested.

dependency_keyslist of str, optional

A list of dependency keys to filter the dependency graph. If not provided, the entire dependency graph will be returned.

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

Dependency graph results.

async get_manifest(uri)

Request the manifest of a dataset by URI.

async get_me()

Request the current user info.

async get_my_summary()

Overall summary of datasets accessible to the current user.

async get_readme(uri)

Request the README.yml of a dataset by URI.

async get_summary(username=None)

Overall summary of datasets accessible to a user.

If no username specified, query currently authenticated user.

async get_tags(uri)

Request the tags of a dataset by URI.

async get_user(username=None)

Request user info.

If no username specified, query currently authenticated user.

async get_users(page_number=1, page_size=10, sort_fields=['username'], sort_order=[1], pagination={}, sorting={})

Request a list of users. (Needs admin privileges.)

Parameters

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

pagination: dict, optional
Dictionary filled with data from the X-Pagination response header, e.g.

‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

sort_fields: str or list of str, optional

default is “uri”

sort_order: int or list of int of ASCENDING (1) or DESCENDING (-1)

default is ASCENDING (1)

sortingdict

Dictionary filled with data from the X-Sort response header, e.g. ‘{“sort”: {“uuid”: 1}}’ for ascending sorting by uuid

Returns

list of dict

User information including username, email, roles, etc.

async get_versions()

Request versions from the server

graph(uuid, dependency_keys=None, page_number=1, page_size=10, pagination={})
property header
list_base_uris(page_number=1, page_size=10, pagination={})
list_users(page_number=1, page_size=10, pagination={})

Request a list of users. (Needs admin privileges.)

lookup(uuid, page_number=1, page_size=10, pagination={})

Search for entries by a specific UUID.

manifest(uri)

Request the manifest of a dataset by URI. Deprecated.

query(query, creator_usernames=None, base_uris=None, uuids=None, tags=None, page_number=1, page_size=10, sort_fields=['uri'], sort_order=[1], pagination={}, sorting={})
readme(uri)

Request the README.yml of a dataset by URI. Deprecated.

async register_base_uri(base_uri, users_with_search_permissions=[], users_with_register_permissions=[])

Register or update a base URI. (Needs admin privileges.)

async register_dataset(uri, base_uri, readme, manifest, uuid, name, type, creator_username, frozen_at, created_at, annotations, tags, number_of_items, size_in_bytes)

Register or update a dataset using URI.

async register_user(username, is_admin=False)

Register or update a user. (Needs admin privileges.)

search(keyword, page_number=1, page_size=10, pagination={})

Free text search.

Parameters

keywordstr

free text search text

page_numberint, optional

The page number of the results, default is 1.

page_sizeint, optional

The number of results per page, default is 10.

paginationdict

dictionary filled with data from the X-Pagination response header, e.g. ‘{“total”: 124, “total_pages”: 13, “first_page”: 1, “last_page”: 13, “page”: 1, “next_page”: 2}’

Returns

jsonlist of dict

search results

summary()

Overall summary of datasets accessible to a user.

user_info(username)

Request user info. Deprecated.

versions()

Request versions from the server. Deprecated.