Compliance Policies Client

Compliance Policies interface

Access to the compliance_policies endpoint.

The user is not expected to use this class directly. It is an attribute of the Archivist class.

For example instantiate an Archivist instance and execute the methods of the class:

with open(".auth_token", mode="r") as tokenfile:
    authtoken = tokenfile.read().strip()

# Initialize connection to Archivist
arch = Archivist(
    "https://app.datatrails.ai",
    authtoken,
)

# A 'Since' policy
asset = arch.compliance_policies.create(
    ComplianceTypeSince(...)
)
class archivist.compliance_policies.CompliancePolicy[source]

CompliancePolicy object has dictionary of all the compliance policy attributes.

property name

name of the compliance policy

Type:

str

class archivist.compliance_policies._CompliancePoliciesClient(archivist_instance: Archivist)[source]

CompliancePoliciesClient

Access to compliance policy entities using CRUD interface. This class is usually accessed as an attribute of the Archivist class.

Parameters:

archivist (Archivist) -- Archivist instance

count(*, props: dict[str, Any] | None = None) int[source]

Count compliance policies.

Counts number of compliance policies that match criteria.

Parameters:

props (dict) -- e.g. {"compliance_type": "COMPLIANCE_RICHNESS" }

Returns:

integer count of compliance policies.

create(policy: CompliancePolicySince | CompliancePolicyCurrentOutstanding | CompliancePolicyPeriodOutstanding | CompliancePolicyDynamicTolerance | CompliancePolicyRichness) CompliancePolicy[source]

Create A compliance policy

Parameters:
  • policy (CompliancePolicy) -- the policy object.

  • of (One) -- CompliancePolicySince CompliancePolicyCurrentOutstanding CompliancePolicyPeriodOutstanding CompliancePolicyDynamicTolerance CompliancePolicyRichness

Returns:

CompliancePolicy instance

create_from_data(data: dict[str, Any]) CompliancePolicy[source]

Create compliance_policy

Creates compliance_policy with request body from data stream. Suitable for reading data from a file using json.load or yaml.load

Parameters:

data (dict) -- request body of compliance_policy.

Returns:

CompliancePolicy instance

delete(identity: str) dict[str, Any][source]

Delete Compliance Policy

Deletes compliance policy.

Parameters:
  • identity (str) -- compliance policy identity

  • compliance_policies/xxxxxxxxxxxxxxxxxxxxxxx (e.g.)

Returns:

CompliancePolicy instance - empty?

list(*, page_size: int | None = None, props: dict[str, Any] | None = None)[source]

List compliance policies.

Lists compliance policies that match criteria.

Parameters:
  • props (dict) -- optional e.g. {"compliance_type": "COMPLIANCE_DYNAMIC_TOLERANCE" }

  • page_size (int) -- optional page size. (Rarely used).

Returns:

iterable that returns CompliancePolicy instances

read(identity: str) CompliancePolicy[source]

Read compliance policy

Reads compliance policy.

Parameters:

identity (str) -- compliance policy identity e.g. compliance_policies/xxxxxxxxxxxxxxxxxxxxxxx

Returns:

CompliancePolicy instance

read_by_signature(*, props: dict[str, Any] | None = None)[source]

Read compliance policy by signature.

Reads compliance policy that meets criteria. Only one compliance policy is expected.

Parameters:

props (dict) -- e.g. {"display_name": "foo" }

Returns:

CompliancePolicy instance