Skip to main content

DCR operations

import decentriq_platform.legacy as dq

user_email = "test_user@company.com"
api_token = "@@ YOUR TOKEN HERE @@"

client = dq.create_client(user_email, api_token)
enclave_specs = dq.enclave_specifications.versions([...])

auth, _ = client.create_auth_using_decentriq_pki(enclave_specs)
session = client.create_session(auth, enclave_specs)

builder = dq.DataRoomBuilder("My DCR", enclave_specs=enclave_specs)
builder.add_user_permission(
email=user_email,
authentication_method=client.decentriq_pki_authentication,
permissions=[
dq.Permissions.update_data_room_status()
]
)
dcr = builder.build()
DCR_ID = session.publish_data_room(dcr)

List all DCRs

The Client class can be used to retrieve information about all existing Data Clean Rooms.

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"])

Retrieve Audit Log

Retrieve the tamper-proof audit log that stores information about each interaction with the DCR:

audit_log = session.retrieve_audit_log(DCR_ID)
print(audit_log.log.decode())

Stop DCR

Stop a Data Clean Room so it cannot be interacted with anymore:

session.stop_data_room(DCR_ID)
new_status = session.retrieve_data_room_status(DCR_ID)