Skip to main content

decentriq_platform.archv2

Sub-modules

  • decentriq_platform.archv2.client
  • decentriq_platform.archv2.compute_job
  • decentriq_platform.archv2.materialization
  • decentriq_platform.archv2.release_policy_builder
  • decentriq_platform.archv2.secret
  • decentriq_platform.archv2.session

Classes

ClientV2

ClientV2(
api: decentriq_platform.api.Api,
)

check_data_labs_compatibility

def check_data_labs_compatibility(
self,
data_room_id: str,
data_lab_ids: List[str],
)> decentriq_platform.archv2.client.DataLabCompatibilityResponse

create_data_lab

def create_data_lab(
self,
create_data_lab: Union[Dict[str, ForwardRef('JSONType')], List[ForwardRef('JSONType')], str, int, float, bool, ForwardRef(None)],
verification_key: bytes,
)> decentriq_platform.archv2.client.DataLabV2

create_data_room

def create_data_room(
self,
create_data_room: Union[Dict[str, ForwardRef('JSONType')], List[ForwardRef('JSONType')], str, int, float, bool, ForwardRef(None)],
verification_key: bytes,
)> decentriq_platform.archv2.client.DataRoom

create_job

def create_job(
self,
data_room_id: str,
data_room_compute_action: Union[Dict[str, ForwardRef('JSONType')], List[ForwardRef('JSONType')], str, int, float, bool, ForwardRef(None)],
freshness_token: Optional[str] = None,
mode: Optional[Literal['always', 'if_stale']] = None,
)> decentriq_platform.archv2.client.CreatedJob

Fire a compute action.

mode="if_stale" reuses the action's newest completed run when it belongs to the job the current state derives (that state's materialization is the current one) instead of running again; the returned run_status is COMPLETED iff a run was reused.

delete_data_lab

def delete_data_lab(
self,
data_lab_id: str,
)> None

download_job_raw_errors

def download_job_raw_errors(
self,
job_id: str,
)> decentriq_platform.archv2.client.RawErrorsView

get_data_lab

def get_data_lab(
self,
data_lab_id: str,
verification_key: bytes,
)> decentriq_platform.archv2.client.DataLabV2

get_data_labs

def get_data_labs(
self,
user_id: str,
verification_key: bytes,
)> List[decentriq_platform.archv2.client.DataLabV2]

get_data_room

def get_data_room(
self,
data_room_id: str,
verification_key: bytes,
)> decentriq_platform.archv2.client.DataRoom

get_data_room_action_info

def get_data_room_action_info(
self,
data_room_id: str,
data_room_compute_action: Union[Dict[str, ForwardRef('JSONType')], List[ForwardRef('JSONType')], str, int, float, bool, ForwardRef(None)],
)> decentriq_platform.archv2.client.Action

get_data_room_actions

def get_data_room_actions(
self,
data_room_id: str,
)> decentriq_platform.archv2.client.DataRoomActionsView

get_data_room_audit_log

def get_data_room_audit_log(
self,
data_room_id: str,
verification_key: bytes,
)> decentriq_platform.archv2.client.DataRoomAuditLog

get_data_room_policies

def get_data_room_policies(
self,
data_room_id: str,
policy_ids: List[str],
)> Dict[str, Union[decentriq_platform.archv2.client.PolicyNotFound, decentriq_platform.archv2.client.PolicyNotProvisioned, decentriq_platform.archv2.client.PolicyMetadata]]

get_job

def get_job(
self,
job_id: str,
)> decentriq_platform.archv2.client.Job

get_job_freshness

def get_job_freshness(
self,
job_id: str,
)> bool

get_job_results_as_decentriq_user

def get_job_results_as_decentriq_user(
self,
job_id: str,
)> bytes

Fetch the result zip via GET /jobs/:job_id/results.

Requires a Decentriq SuperAdmin (or SuperAdminReadOnly) token and an MDCR created with share_aggregated_results=True. The enclave enforces check_api_platform_user_permission_for_result.

get_job_status

def get_job_status(
self,
job_id: str,
)> decentriq_platform.archv2.client.JobStatusView

get_job_tasks

def get_job_tasks(
self,
job_id: str,
)> decentriq_platform.archv2.client.JobTasksView

get_materialization

def get_materialization(
self,
materialization_id: str,
)> decentriq_platform.archv2.client.MaterializationView

Fetch a materialization and its execution history. Owner-scoped: visible to the creator, their org, or an admin.

get_run_status

def get_run_status(
self,
run_id: str,
)> decentriq_platform.archv2.client.RunView

list_data_room_runs

def list_data_room_runs(
self,
data_room_id: str,
action: Union[Dict[str, ForwardRef('JSONType')], List[ForwardRef('JSONType')], str, int, float, bool, ForwardRef(None)] = None,
limit: Optional[int] = None,
next_cursor: Optional[str] = None,
prev_cursor: Optional[str] = None,
)> decentriq_platform.archv2.client.RunsPage

List one page of the runs fired against the data room, newest first, cursor-paginated. action optionally narrows the listing to one compute action, given as action JSON.

list_materializations

def list_materializations(
self,
user_id: str,
limit: Optional[int] = None,
next_cursor: Optional[str] = None,
prev_cursor: Optional[str] = None,
)> decentriq_platform.archv2.client.MaterializationsPage

List one page of the materializations created by the user, newest first, cursor-paginated. Owner-scoped like get_materialization: visible to the user, their org, or an admin. Execution history is omitted from list items — fetch it via get_materialization.

stop_data_room

def stop_data_room(
self,
data_room_id: str,
)> None

ComputeJob

ComputeJob(
dcr_id: str,
action: DataRoomComputeAction,
result_zip_file_name: str,
client: Client,
as_decentriq_admin: bool = False,
)

Abstract base class for compute jobs in archv2 DCRs.

Initialize a compute job.

Parameters:

  • dcr_id: The identifier for the DCR or DataLab
  • action: The compute action to perform
  • result_zip_file_name: The name of the file in the zip to get the result from
  • client: The client instance for API communication
  • as_decentriq_admin: When True, retrieve results via GET /jobs/:job_id/results. Requires a Decentriq SuperAdmin token and the DCR's share_aggregated_results=True.

Ancestors (in MRO)

  • abc.ABC Descendants
  • decentriq_platform.data_lab.compute_job.DataLabEnhancedValidationStatusJob
  • decentriq_platform.data_lab.compute_job.DataLabStatisticsJob
  • decentriq_platform.data_lab.compute_job.DataLabValidationStatusJob
  • decentriq_platform.data_lab.compute_job.ValidationReportJob
  • decentriq_platform.media.compute_job.MediaAudienceUserListJob
  • decentriq_platform.media.compute_job.MediaDataAttributesJob
  • decentriq_platform.media.compute_job.MediaEstimateAudienceSizeJob
  • decentriq_platform.media.compute_job.MediaGetAudiencesJob
  • decentriq_platform.media.compute_job.MediaGetCustomAudiencesJob
  • decentriq_platform.media.compute_job.MediaGetSeedAudiencesJob
  • decentriq_platform.media.compute_job.MediaInsightsJob
  • decentriq_platform.media.compute_job.MediaLookalikeAudienceStatisticsJob
  • decentriq_platform.media.compute_job.MediaMatchingValidationReportJob
  • decentriq_platform.media.compute_job.MediaModelQualityReportJob
  • decentriq_platform.media.compute_job.MediaOverlapStatisticsJob
  • decentriq_platform.media.compute_job.ValidationReportJob

download_result

def download_result(
self,
task_result_hash: str,
)> io.RawIOBase

Download the result of the compute job.

Parameters:

  • task_result_hash: The hash of the task result to download

Returns:

  • The result of the compute job

get_result

def get_result(
self,
)> bytes

Get the result of the compute job.

Returns:

  • The content of the result file as bytes or raises an exception if the job failed

get_result_as_zipfile

def get_result_as_zipfile(
self,
)> zipfile.ZipFile

Get the result of the compute job as a zipfile.ZipFile.

Returns:

  • The content of the result file as a zipfile.ZipFile. If the job failed, an Exception will be raised.

is_complete

def is_complete(
self,
)> bool

Check if the compute job is complete.

Returns:

  • True if the job is complete, False otherwise

result

def result(
self,
)> Any

Get the parsed result of the compute job.

Each job subclass should implement this method and return the appropriate type which represents the job result.

run

def run(
self,
)> None

Run the compute job.

Raises:

  • Exception: If the computation has already been run

wait_for_completion

def wait_for_completion(
self,
timeout: Optional[int] = None,
sleep_interval: int = 1,
)> Self

Wait for the compute job to complete.

Parameters:

  • timeout: The maximum time to wait for the job to complete, in seconds
  • sleep_interval: The interval to wait between checks, in seconds

Returns:

  • The compute job

DataLabV2

DataLabV2(
*args,
**kwargs,
)

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

Ancestors (in MRO)

  • builtins.dict

JobStatus

JobStatus(
*args,
**kwds,
)

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

Ancestors (in MRO)

  • builtins.str
  • enum.Enum

MaterializationDataset

MaterializationDataset(
name_template: str,
owners: List[str],
readers: List[str] = <factory>,
zip_path: Optional[str] = None,
)

The owned Dataset a materialization produces (the target).

Parameters:

  • name_template: Name for the produced Dataset, rendered enclave-side. {yyyy}/{mm}/{dd}/{q} expand from the enclave clock and {run_id} is the firing's run id from the MaterializeJobResult request.
  • owners: User ids granted Owner on the produced Dataset's key; at least one is required.
  • readers: User ids granted read access on the produced Dataset's key.
  • zip_path: Extract a single file from the result's zip at this path; None materializes the result bytes as-is.

MaterializationSource

MaterializationSource(
dcr_id: str,
action: Union[JSONType, object],
task_name: str,
result_selector: str = 'success',
)

The completed DCR compute result a materialization reads from.

Parameters:

  • dcr_id: Source DataRoom whose completed result is materialized.
  • action: The DCR compute action that produces the result — a ddc DataRoomComputeAction (pydantic) or its camelCase JSON dict.
  • task_name: GlobalName of the task in the source compute graph.
  • result_selector: Which result of the action to materialize.

Secret

Secret(
secret: bytes,
state: decentriq_dcr_compiler._schemas.secret_store_entry_state.SecretStoreEntryState,
)

Secret(secret: bytes, state: decentriq_dcr_compiler._schemas.secret_store_entry_state.SecretStoreEntryState)

SessionV2

SessionV2(
client: Client,
connection: Connection,
)

Class for managing the communication with an enclave.

Session instances should not be instantiated directly but rather be created using a Client object using decentriq_platform.Client.create_session_v2.

create_materialization

def create_materialization(
self,
source: MaterializationSource,
dataset: MaterializationDataset,
)> str

Create a materialization and return the materialization ID.

Takes the source result to materialize and the dataset to produce; the enclave derives createdBy/createdAt/sourceActionId and signs the stored Materialization. Serialized as ddc JSON bytes — like dcrAction — since the entity is a ddc serde type, not a proto.

create_policy

def create_policy(
self,
policy: ReleasePolicy,
)> str

Create a release policy and return the policy ID.

create_secret

def create_secret(
self,
secret: Secret,
)> str

Store a secret in the user's own enclave-protected secret store

get_dataset_secret_id

def get_dataset_secret_id(
self,
manifest_hash: str,
)> str

get_secret

def get_secret(
self,
secret_id: str,
)> Tuple[decentriq_platform.archv2.secret.Secret, int]

remove_secret

def remove_secret(
self,
secret_id: str,
expected_cas_index: int,
)> bool

send_authenticated_request

def send_authenticated_request(
self,
authenticated_request: AuthenticatedRequest,
)> gcg_pb2.AuthenticatedResponse

send_data_room_state_action_request

def send_data_room_state_action_request(
self,
data_room_id: str,
action: JSONType,
)> Union[Dict[str, JSONType], List[JSONType], str, int, float, bool, ForwardRef(None)]

Send a DCR action request.

send_export_result_as_dataset_request

def send_export_result_as_dataset_request(
self,
job_id: str,
task_result_hash: str,
zip_path: Optional[str],
)> Tuple[str, str, str]

Export a result as a dataset.

send_get_verification_key_request

def send_get_verification_key_request(
self,
)> bytes

Retrieve the verification key for a DCR.

send_retrieve_result_encryption_key_request

def send_retrieve_result_encryption_key_request(
self,
job_id: str,
task_result_hash: str,
)> Tuple[str, bytes]

Retrieve the manifest hash and encryption key for a result.

send_secret_store_request

def send_secret_store_request(
self,
request: SecretStoreRequest,
)> secret_store_pb2.SecretStoreResponse

update_secret_acl

def update_secret_acl(
self,
secret_id: str,
new_acl: v0.SecretStoreEntryAcl,
expected_cas_index: int,
)> bool

Update a secret ACL