Cortex Python Reference

Profile Client

class cortex_profiles.ext.clients.Profile(profile: Union[dict, cortex_common.types.profiles.Profile], profile_client: cortex_profiles.ext.rest.ProfilesRestClient)

Accessing an existent Cortex Profile. Not meant to be explicitly instantiated by sdk users.

allVersions() → List[cortex_common.types.summaries.ProfileVersionSummary]

Lists the different versions of the profile … If a schema name is specified, only versions of the profile against that schema are returned :return:

atVersion(schema_id: str, profile_version: int) → Optional[cortex_common.types.profiles.Profile]

Gets a specific version of a profile. :param schema_id: :param profile_version: :return:

attribute(attributeKey: str) → Optional[cortex_profiles.ext.clients.ProfileAttribute]
Parameters

attributeKey

Returns

delete(schema_id: str) → bool

Deletes the profile built against a specific schema. :return:

deleteAll() → bool

Deletes all instances of the profile against all schemas. :return:

static get_profile(profileId: str, profile_client: cortex_profiles.ext.rest.ProfilesRestClient) → Optional[cortex_profiles.ext.clients.Profile]

Fetches a profile adhering to a specific schema …

historic(schema_id: str) → Optional[cortex_common.types.profiles.HistoricProfile]

Gets the historic version of the profile :return:

latest(schema_id: str) → Optional[cortex_common.types.profiles.Profile]

Returns the latest version of the profile against a specific schema … :param schema_id: :return:

versions(schema_name: str) → List[cortex_common.types.summaries.ProfileVersionSummary]

Lists the different versions of the profile against a specific schema. :return:

ProfileSchema Client

class cortex_profiles.ext.clients.ProfileSchema(schema_name_or_id: str, profile_client: cortex_profiles.ext.rest.ProfilesRestClient)

Accessing an existent Cortex ProfileSchema.

delete(all: bool = False) → bool

Deletes the schema … :param all: This flag is needed because the default behavior of getting a schema without specifying a version resolves to the latest schema … thus if someone wants to delete all versions of the schema, not just the latest, they must explicitly do so. :param consider_dne_successful: This determines how to treat the deletion of schemas that don’t exist prior to the delete call … :return:

exists() → bool

Returns whether or not the schema requested actually exists … :return:

static get_schema(schema_name_or_id: str, profile_client: cortex_profiles.ext.rest.ProfilesRestClient) → cortex_profiles.ext.clients.ProfileSchema

Fetches the requested schema by id …

latest() → Optional[cortex_common.types.schemas.ProfileSchema]

Returns the id of the latest version of the specified schema. :return: