Skip to main content

Finding a clean room

This page describes how to get information about existing DCRs and what operations can be performed on a DCR itself.

import decentriq_platform as dq
from decentriq_platform.analytics import AnalyticsDcrBuilder

USER_EMAIL = "@@ YOUR EMAIL HERE @@"
API_TOKEN = "@@ YOUR TOKEN HERE @@"

client = dq.create_client(USER_EMAIL, API_TOKEN)
enclave_specs = dq.enclave_specifications.latest()

builder = AnalyticsDcrBuilder(client=client)
builder.\
with_name("My DCR").\
with_owner(USER_EMAIL).\
with_description("My test DCR")

dcr_definition = builder.build()
dcr = client.publish_analytics_dcr(dcr_definition)

DCR_ID = dcr.id

List all DCRs

Use a Client to get a list of all DCRs with their descriptions.

all_dcrs = client.get_data_room_descriptions()
# Each DCR is a Python dictionary that contains information about the DCR:
for dcr in all_dcrs:
print(dcr["id"], dcr["title"])

Get description for one DCR

Use a Client to get a specific DCR description.

dcr_description = client.get_data_room_description(DCR_ID, enclave_specs=enclave_specs)
# Each DCR is a Python dictionary that contains information about the DCR:
print(dcr_description)