utils.rcclient

Subpackages

Submodules

Package Contents

Classes

LogUtil

AbstractExpression

The abstract base class for all expressions except GroupExpression.

ExpressionFactory

ItemExpression

A class used to build item an expression for segment.

RecipeExpression

A class used to build item an expression for segment.

BooleanExpression

A class used to build boolen expression for segment.

GlobalRefExpression

The abstract base class for all expressions except GroupExpression.

DataLabelExpression

A class used to build DataLabel expression for segment.

GroupExpression

A class used to build logical expression for segment.

Condition

A class which builds condition object for Segment.

Segment

A class which creates segment for a given dataset.

Segment

A class which creates segment for a given dataset.

Recipe

LogUtil

Scenario

A class representing a scenario object that contains various properties

LogUtil

Code

Recipe

LogUtil

GlobalVariable

A class representing a Global Variable.

Operator

str(object='') -> str

DataType

str(object='') -> str

ExpressionType

str(object='') -> str

GroupType

str(object='') -> str

NotebookUtils

LogUtil

SignedUrlResult

Artifact

Attributes

logger

logger

logger

logger

logger

class utils.rcclient.LogUtil
classmethod get_logger()
classmethod get_plain_logger()
classmethod get_pandas_logger()
classmethod get_papermill_logger()
classmethod set_basic_config(format='%(levelname)s:%(message)s', level=logging.INFO)
classmethod highlight_msg(msg: str)
utils.rcclient.logger
class utils.rcclient.AbstractExpression

The abstract base class for all expressions except GroupExpression.

and_with(expr: ItemExpression | GroupExpression | DataLabelExpression | GlobalRefExpression | BooleanExpression) GroupExpression

Returns rcclient.entities.segment.GroupExpression object representing logical AND between two expressions. The two expressions can be any of the following types:

rcclient.entities.segment.ItemExpression rcclient.entities.segment.GroupExpression rcclient.entities.segment.DataLabelExpression rcclient.entities.segment.GlobalRefExpression rcclient.entities.segment.BooleanExpression

Parameters:

expr – Any expression type object

Returns:

An object of rcclient.entities.segment.GroupExpression

or_with(expr: ItemExpression | GroupExpression | DataLabelExpression | GlobalRefExpression | BooleanExpression) GroupExpression

Returns rcclient.entities.segment.GroupExpression object representing logical OR between two expressions. The two expressions can be any of the following types: rcclient.entities.segment.ItemExpression rcclient.entities.segment.GroupExpression rcclient.entities.segment.DataLabelExpression rcclient.entities.segment.GlobalRefExpression rcclient.entities.segment.BooleanExpression

Parameters:

expr – Any expression type object

Returns:

An object of rcclient.entities.segment.GroupExpression

class utils.rcclient.ExpressionFactory
property expr_type_map
get_expr(expr_type: str)
class utils.rcclient.ItemExpression

Bases: AbstractExpression

A class used to build item an expression for segment.

An ItemExpression is a mathematical expression composed of a variable, an operator and a value. This represents a condition which when applied to dataset creates a segment.

Example:

ItemExpression(
    field='age', operator=Operator.LESSER_OR_EQUAL, value=25
)

This will create a segment of users with age <= 25 years.

field: str
operator: utils.rcclient.enums.segment_enums.Operator
value: str
datatype: utils.rcclient.enums.segment_enums.DataType
expr_type: utils.rcclient.enums.segment_enums.ExpressionType
__post_init__()
classmethod from_(expr: utils.rcclient.dtos.response_dtos.ItemExpressionResponseDto) ItemExpression
class utils.rcclient.RecipeExpression

Bases: ItemExpression

A class used to build item an expression for segment.

An ItemExpression is a mathematical expression composed of a variable, an operator and a value. This represents a condition which when applied to dataset creates a segment.

Example:

ItemExpression(
    field='age', operator=Operator.LESSER_OR_EQUAL, value=25
)

This will create a segment of users with age <= 25 years.

expr_type: utils.rcclient.enums.segment_enums.ExpressionType
__post_init__()
class utils.rcclient.BooleanExpression

Bases: AbstractExpression

A class used to build boolen expression for segment.

A boolen expression is an expression which is either True or False.

Example:

BooleanExpression(expr_type=ExpressionType.ALWAYS_TRUE)

This will create a True expression.

expr_type: utils.rcclient.enums.segment_enums.ExpressionType
__post_init__()
classmethod from_(expr: utils.rcclient.dtos.response_dtos.SimpleExpressionResponseDto) BooleanExpression
class utils.rcclient.GlobalRefExpression

Bases: AbstractExpression

The abstract base class for all expressions except GroupExpression.

name: str
expr_type: utils.rcclient.enums.segment_enums.ExpressionType
__post_init__()
classmethod from_(expr: utils.rcclient.dtos.response_dtos.SimpleExpressionResponseDto) GlobalRefExpression
class utils.rcclient.DataLabelExpression

Bases: AbstractExpression

A class used to build DataLabel expression for segment.

A data label expression is an expression… .

Example:

DataLabelExpression(data_labels: ['dl1', 'dl2'])
data_labels: list[str]
expr_type: utils.rcclient.enums.segment_enums.ExpressionType
__post_init__()
classmethod from_(expr: utils.rcclient.dtos.response_dtos.SimpleExpressionResponseDto) DataLabelExpression
class utils.rcclient.GroupExpression

A class used to build logical expression for segment.

A goup expression is an expression which creates a logical expression out of 2 expressions of any type.

Example:

bool_ex = BooleanExpression(expr_type=ExpressionType.ALWAYS_TRUE)
item_ex = ItemExpression(
    field='f1', operator=Operator.EQUAL_TO, value=25
)
GroupExpression(
    group_type=GroupType.AND, group_elements=[bool_ex, item_ex]
)

This will create an expression which will do AND between bool_ex and item_ex.

group_type: utils.rcclient.enums.segment_enums.GroupType
group_elements: list[BooleanExpression | GroupExpression | ItemExpression | GlobalRefExpression | DataLabelExpression]
expr_type: utils.rcclient.enums.segment_enums.ExpressionType
expr_factory: ClassVar[ExpressionFactory]
__post_init__()
classmethod from_(expr: utils.rcclient.dtos.response_dtos.GroupExpressionResponseDto) GroupExpression
and_with(expr: ItemExpression | GroupExpression | DataLabelExpression | GlobalRefExpression | BooleanExpression) GroupExpression

This creates a logical expression which does AND operation on caller object and object passed in args. Returns a rcclient.entities.segment.GroupExpression object. If expr is None, it return the same object it was called on.

or_with(expr: ItemExpression | GroupExpression | DataLabelExpression | GlobalRefExpression | BooleanExpression) GroupExpression

This creates a logical expression which does OR operation on caller object and object passed in args. Returns a rcclient.entities.segment.GroupExpression object. If expr is None, it return the same object it was called on.

class utils.rcclient.Condition

A class which builds condition object for Segment.

expression: GroupExpression | ItemExpression | BooleanExpression | GlobalRefExpression | DataLabelExpression | RecipeExpression
expr_factory: ClassVar[ExpressionFactory]
__post_init__()
classmethod from_(condition: utils.rcclient.dtos.response_dtos.ConditionResponseDto) Condition
class utils.rcclient.Segment

A class which creates segment for a given dataset.

It requires name, description, condition and dataset_id to the constructor to create an object. This class gives the ability to perform following operations on the object:

save - Save the object.

try_it - Returns sample data of the segment.

get_data - Returns sample data of the segment.

delete - Delete the object.

Example:

expr = ItemExpression(
    field='age', operator=Operator.LESS_THAN_EQUAL, value=25
)
segment = Segment(
    name='age_less_than_25',
    description="Employees with age less than 25 years",
    codition=Condition(expr),
    dataset_id='employee_dataset_id',
    row_limit=30
)
segment.save()

Segment can also find segments by name and dataset_id using find method and get specific object by segment id using get method. find and get are classmethods and can be called on Segment class.

Example:

Segment.find(name="age_less_than_25", dataset_id='employee_dataset_id')
Segment.get('employee_segment_id')
name: str
condition: Condition
dataset_id: str
_id: str
description: str
created
row_limit: int = 10
segment_service: ClassVar[utils.rcclient.services.segment_service.SegmentService]
feature_service: ClassVar[utils.rcclient.services.feature_service.FeatureService]
__post_init__()
classmethod from_(segment_res_dto: utils.rcclient.dtos.response_dtos.SegmentResponseDto) Segment
classmethod get(_id: str) Segment
classmethod find(dataset_id: str, name: str = None) list[Segment]
add_condition(expr: ItemExpression | GlobalRefExpression | GroupExpression | DataLabelExpression | BooleanExpression) None
get_data(num_rows: int = None) utils.rcclient.dtos.response_dtos.SegmentData
try_it() utils.rcclient.dtos.response_dtos.SegmentData
save() bool
delete() None
__resolve_condition_attributes_datatype(features: Dict[str, utils.rcclient.enums.segment_enums.DataType], expr=None) None
class utils.rcclient.Segment

A class which creates segment for a given dataset.

It requires name, description, condition and dataset_id to the constructor to create an object. This class gives the ability to perform following operations on the object:

save - Save the object.

try_it - Returns sample data of the segment.

get_data - Returns sample data of the segment.

delete - Delete the object.

Example:

expr = ItemExpression(
    field='age', operator=Operator.LESS_THAN_EQUAL, value=25
)
segment = Segment(
    name='age_less_than_25',
    description="Employees with age less than 25 years",
    codition=Condition(expr),
    dataset_id='employee_dataset_id',
    row_limit=30
)
segment.save()

Segment can also find segments by name and dataset_id using find method and get specific object by segment id using get method. find and get are classmethods and can be called on Segment class.

Example:

Segment.find(name="age_less_than_25", dataset_id='employee_dataset_id')
Segment.get('employee_segment_id')
name: str
condition: Condition
dataset_id: str
_id: str
description: str
created
row_limit: int = 10
segment_service: ClassVar[utils.rcclient.services.segment_service.SegmentService]
feature_service: ClassVar[utils.rcclient.services.feature_service.FeatureService]
__post_init__()
classmethod from_(segment_res_dto: utils.rcclient.dtos.response_dtos.SegmentResponseDto) Segment
classmethod get(_id: str) Segment
classmethod find(dataset_id: str, name: str = None) list[Segment]
add_condition(expr: ItemExpression | GlobalRefExpression | GroupExpression | DataLabelExpression | BooleanExpression) None
get_data(num_rows: int = None) utils.rcclient.dtos.response_dtos.SegmentData
try_it() utils.rcclient.dtos.response_dtos.SegmentData
save() bool
delete() None
__resolve_condition_attributes_datatype(features: Dict[str, utils.rcclient.enums.segment_enums.DataType], expr=None) None
class utils.rcclient.Recipe
class RunConfig
name: str
_id: str
variables: dict
classmethod from_(run_config: utils.rcclient.dtos.response_dtos.RecipeResponseDto.RunConfigResponseDto) Recipe
_id: str
name: str
run_configs: list[Recipe]
recipe_service: ClassVar[utils.rcclient.services.recipe_service.RecipeService]
classmethod from_(recipe: utils.rcclient.dtos.response_dtos.RecipeResponseDto) Recipe
classmethod find(project_id: str)
stop()
class utils.rcclient.LogUtil
classmethod get_logger()
classmethod get_plain_logger()
classmethod get_pandas_logger()
classmethod get_papermill_logger()
classmethod set_basic_config(format='%(levelname)s:%(message)s', level=logging.INFO)
classmethod highlight_msg(msg: str)
utils.rcclient.logger
class utils.rcclient.Scenario

A class representing a scenario object that contains various properties such as its name, project ID, description, variables, shared variables, segment IDs, and segments. It also includes several methods to interact with the ScenarioService and manage the scenario object.

name

The name of the scenario.

Type:

str

project_id

The ID of the project the scenario belongs to. Defaults to None.

Type:

str, optional

_id

The ID of the scenario. Defaults to None.

Type:

str, optional

description

A description of the scenario. Defaults to None.

Type:

str, optional

variables

A list of variables associated with the scenario. Defaults to an empty list.

Type:

List[Scenario.Variable], optional

shared_variables

A dictionary of shared variables associated with the scenario. Defaults to an empty dictionary.

Type:

Dict[str, str], optional

segment_ids

A list of segment IDs associated with the scenario. Defaults to an empty list.

Type:

List[str], optional

segments

A list of segment objects associated with the scenario. Defaults to an empty list.

Type:

List[Segment], optional

scenario_service

The service used to interact with the scenarios.

Type:

ClassVar[ScenarioService]

from_(res_dto)

Constructs a scenario object from a ScenarioResponseDto object.

get(_id)

Retrieves a scenario object by ID.

find(project_id, name=None, experiment_id=None)

Retrieves a list of scenarios that match the given criteria.

save()

Saves the scenario object.

delete()

Deletes the scenario object.

add_segments(segments)

Adds the given segments to the scenario.

class Variable

A class representing a variable associated with a scenario.

variable_name

The name of the variable.

Type:

str

variable_value

The value of the variable.

Type:

str

recipe_name

The name of the recipe the variable belongs to. Defaults to None.

Type:

str, optional

transform_name

The name of the transform the variable belongs to. Defaults to None.

Type:

str, optional

variable_name: str
variable_value: str
recipe_name: str
transform_name: str
classmethod from_(res_dto: utils.rcclient.dtos.response_dtos.ScenarioResponseDto.VariableResponseDto) Scenario
Constructs a Variable object from a

ScenarioResponseDto.VariableResponseDto object.

Parameters:

res_dto (ScenarioResponseDto.VariableResponseDto) – The DTO object containing the variable data.

Returns:

The constructed Variable object.

Return type:

Scenario.Variable

classmethod from_recipe(recipe: utils.rcclient.entities.recipe.Recipe)

Constructs a list of Variable objects from a recipe object.

Parameters:

recipe (Recipe) – The recipe object to extract variables from.

Returns:

The list

Return type:

List[Scenario.Variable]

name: str
project_id: str
_id: str
description: str
variables: List[Scenario]
shared_variables: Dict[str, str]
segment_ids: List[str]
segments: List[utils.rcclient.entities.segment.Segment]
scenario_service: ClassVar[utils.rcclient.services.scenario_service.ScenarioService]
classmethod from_(res_dto: utils.rcclient.dtos.response_dtos.ScenarioResponseDto) Scenario

Create a new Scenario instance from a ScenarioResponseDto object.

Parameters:

res_dto – A ScenarioResponseDto object containing the information about the scenario.

Returns:

A new Scenario instance with the information from the

ScenarioResponseDto object.

classmethod get(_id: str) Scenario

Retrieves a scenario by its ID using a scenario service.

Parameters:

_id (str) – The ID of the scenario to retrieve.

Returns:

The retrieved scenario.

Return type:

Scenario

Raises:

ValueError – If the scenario with the given ID could not be found.

classmethod find(project_id: str, name: str = None, experiment_id: str = None) List[Scenario]

Find scenarios that match the given parameters.

Parameters:
  • project_id – The ID of the project to search in.

  • name – The name of the scenarios to search for (optional).

  • experiment_id – The ID of the experiment to search in (optional).

Returns:

A list of Scenario objects that match the search criteria.

save() Scenario
Saves the current Scenario object in the database and returns the saved

object.

Returns:

The saved Scenario object.

Return type:

Scenario

delete() None

Deletes the current scenario and logs the success.

Raises:

An Exception if deletion fails.

add_segments(segments: List[utils.rcclient.entities.segment.Segment]) None

Adds the provided list of segments to the current Scenario object’s segment_ids attribute, excluding segments with None _id attributes.

Parameters:

segments (List[Segment]) – A list of Segment objects to be added to the current Scenario object’s segments.

Returns:

None

class utils.rcclient.LogUtil
classmethod get_logger()
classmethod get_plain_logger()
classmethod get_pandas_logger()
classmethod get_papermill_logger()
classmethod set_basic_config(format='%(levelname)s:%(message)s', level=logging.INFO)
classmethod highlight_msg(msg: str)
utils.rcclient.logger
class utils.rcclient.Code
recipe_id: str
entity_ids: List[str]
user_input: str
ask_ai: bool = False
with_signature: bool = True
outputs: List[str]
charts: List[str]
__body: str
__code: str
__prompt: str
recipe_service: ClassVar[utils.rcclient.services.recipe_service.RecipeService]
classmethod from_(res_dto)

Creates an instance of the class from a response DTO object.

Parameters:

res_dto – The response DTO object containing the necessary data.

Returns:

An instance of the class with attributes initialized from the response DTO object.

Return type:

cls

show()
get_body()
get_code()
get_prompt()
update(body: str)
classmethod generate_code(recipe_id: str, user_input: str, entity_ids: List[str], ask_ai: bool, with_signature: bool, outputs: List[str], charts: List[str])

Generates code using the specified parameters.

Parameters:
  • recipe_id (str) – The ID of the recipe.

  • scenario_id (str) – The ID of the scenario.

  • user_input (str) – The user input for the code generation.

  • ask_ai (bool) – Flag indicating whether to include AI-generated code.

  • with_signature (bool) – Flag indicating whether to include function signature.

  • outputs (List[str]) – List of outputs for the generated code.

Returns:

The generated code.

Return type:

str

class utils.rcclient.Recipe
class RunConfig
name: str
_id: str
variables: dict
classmethod from_(run_config: utils.rcclient.dtos.response_dtos.RecipeResponseDto.RunConfigResponseDto) Recipe
_id: str
name: str
run_configs: list[Recipe]
recipe_service: ClassVar[utils.rcclient.services.recipe_service.RecipeService]
classmethod from_(recipe: utils.rcclient.dtos.response_dtos.RecipeResponseDto) Recipe
classmethod find(project_id: str)
stop()
class utils.rcclient.LogUtil
classmethod get_logger()
classmethod get_plain_logger()
classmethod get_pandas_logger()
classmethod get_papermill_logger()
classmethod set_basic_config(format='%(levelname)s:%(message)s', level=logging.INFO)
classmethod highlight_msg(msg: str)
utils.rcclient.logger
class utils.rcclient.GlobalVariable

A class representing a Global Variable.

Attributes:

namestr

The name of the Global Variable.

project_idstr, optional

The ID of the project to which this Global Variable belongs.

_idstr, optional

The unique identifier of the Global Variable.

typestr, optional

The data type of the Global Variable.

valuestr, optional

The value of the Global Variable.

gv_serviceClassVar[gv_svc.GlobalVariableService]

An instance of the GlobalVariableService class, used to interact with the platform API.

Methods:

from_(res_dto: res_dtos.GlobalVariableResponseDto) -> GlobalVariable:

Create a new GlobalVariable instance from a GlobalVariableResponseDto object.

get_all(project_id: str) -> List[GlobalVariable]:

Get a list of all Global Variables belonging to the specified project.

get_all_by_solution(solution_id: str) -> List[GlobalVariable]:

Get a list of all Global Variables belonging to the specified solution.

get(_id: str) -> GlobalVariable:

Get a GlobalVariable instance by its unique identifier.

create() -> GlobalVariable:

Create a new Global Variable.

update() -> GlobalVariable:

Update the value of an existing Global Variable.

delete() -> None:

Delete an existing Global Variable.

name: str
project_id: str
_id: str
type: str
value: str
gv_service: ClassVar[utils.rcclient.services.global_variable_service.GlobalVariableService]
classmethod from_(res_dto: utils.rcclient.dtos.response_dtos.GlobalVariableResponseDto) GlobalVariable
classmethod get_all(project_id: str) List[GlobalVariable]

Returns a list of all GlobalVariable objects belonging to the specified project.

Parameters:
  • project_id (str) – The ID of the project to retrieve GlobalVariable

  • for. (objects)

Returns:

A list of GlobalVariable objects belonging to the specified project.

Return type:

List[GlobalVariable]

classmethod get_all_by_solution(solution_id: str) List[GlobalVariable]

Returns a list of all GlobalVariable objects belonging to the specified solution.

Parameters:

solution_id (str) – The ID of the solution to retrieve GlobalVariable objects for.

Returns:

A list of GlobalVariable objects belonging to

the specified solution.

Return type:

List[GlobalVariable]

classmethod get(_id: str) GlobalVariable

Returns the GlobalVariable object with the specified ID.

Parameters:

_id (str) – The ID of the GlobalVariable object to retrieve.

Returns:

The GlobalVariable object with the specified ID.

Return type:

GlobalVariable

create() GlobalVariable

Creates a new GlobalVariable object using the specified data and returns it.

Returns:

The created GlobalVariable object.

Return type:

GlobalVariable

update() GlobalVariable

Updates the existing GlobalVariable object with the specified data and returns it.

Returns:

The updated GlobalVariable object.

Return type:

GlobalVariable

delete() None

Deletes the GlobalVariable object from the database.

Returns:

None

class utils.rcclient.Operator

Bases: str, enum.Enum

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’.

EQUAL_TO = 'EqualTo'
CONTAINS = 'Contains'
GREATER_THAN = 'GreaterThan'
LESS_THAN = 'LessThan'
NOT_EQUAL_TO = 'NotEqualTo'
REG_EX = 'RegEX'
IS_IN_LIST = 'IsInList'
GREATER_OR_EQUAL = 'GreaterOrEqual'
LESSER_OR_EQUAL = 'LesserOrEqual'
IS_NULL = 'IsNull'
IS_NOT_NULL = 'IsNotNull'
class utils.rcclient.DataType

Bases: str, enum.Enum

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’.

DOUBLE = 'DOUBLE'
FLOAT = 'FLOAT'
STRING = 'STRING'
INTEGER = 'INTEGER'
LONG = 'LONG'
TIMESTAMP = 'TIMESTAMP'
BOOLEAN = 'BOOLEAN'
SET = 'SET'
LIST = 'LIST'
MAP = 'MAP'
BLOB = 'BLOB'
EMPTY = 'EMPTY'
ANY = 'ANY'
class utils.rcclient.ExpressionType

Bases: str, enum.Enum

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’.

ITEM = 'item'
GROUP = 'group'
GLOBAL_REF = 'ref'
DATA_LABEL = 'data-label'
ALWAYS_TRUE = 'always-true'
ALWAYS_FALSE = 'always-false'
RECIPE = 'recipe'
class utils.rcclient.GroupType

Bases: str, enum.Enum

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’.

AND = 'AND'
OR = 'OR'
class utils.rcclient.NotebookUtils
static isProduction()
static getArtifactsDir(tenant_id, folderName)
static get_dataapp_config_dir(tenant_id, project_id, scenario_id)
static writeFile(filePath, contents)
static readFile(filePath)
static read_data_frame(file_path, num_rows=None, pandas_lib=None, reader_options={}, schema=None)
static read_excel(file_path, num_rows=None, pandas_lib=None)
static readCSV(filePath, numRows=None, pandas_lib=None, reader_options={})
static readParquet(filePath, numRows=None, pandas_lib=None)
static getStreamlitUrl()
static getMountedDir()
static getTempDir()
static getUploadsDir()
static getChartsDir()
static download_file_to_folder(remote_file_path: str, folder_path: str = None, file_name: str = None)
static write_data_frame(df, file_path, writer_options={})
static get_data_types_from_schema(schema)
class utils.rcclient.LogUtil
classmethod get_logger()
classmethod get_plain_logger()
classmethod get_pandas_logger()
classmethod get_papermill_logger()
classmethod set_basic_config(format='%(levelname)s:%(message)s', level=logging.INFO)
classmethod highlight_msg(msg: str)
utils.rcclient.logger
class utils.rcclient.SignedUrlResult
signedUrl: str
headers: Dict[str:str]
classmethod from_(res_dto: utils.rcclient.dtos.response_dtos.UploadSignedUrlResponseDto) SignedUrlResult
class utils.rcclient.Artifact
name: str
files: List[str]
artifact_service: ClassVar[utils.rcclient.services.artifact_service.ArtifactService]
classmethod from_(res_dto: utils.rcclient.dtos.response_dtos.ArtifactResponseDto) Artifact
classmethod get(name: str) Artifact

Get details of the artifact by name

Parameters:

name (str) – name of the artifact

Returns:

Artifact

classmethod get_all() List[str]

Get all the artifacts that belong to the tenant

Returns:

list of all the artifact names

Return type:

List[str]

classmethod add_file(name: str, file_path: str) None

Add a file from your local file system to the artifact

Parameters:
  • name (str) – name of the artifact

  • file_path (str) – path of the file in your local file system

classmethod delete_file(name: str, file_name: str) None

Delete a file from the artifact

Parameters:
  • name (str) – name of the artifact

  • file_name (str) – name of the file to be deleted

classmethod delete(name: str) None

Delete the whole artifact

Parameters:

name (str) – name of the artifact

classmethod download_file(name: str, file_name: str, folder: str = None) None

Download a file from artifact to your local file system

Parameters:
  • name (str) – name of the artifact

  • file_name (str) – name of the file in artifact file system

  • folder (str) – folder path to download, if None, takes current folder

classmethod download_artifact(name: str, folder: str = None) None

Download all the files in artifact to specified folder :param name: name of the artifact :param folder: folder path to download, if None, takes current folder

Returns:

classmethod download_for_local(artifact_name: str, tenant_id: str)

Download an artifact for local use. This class method allows the user to download an artifact specified by its name for local use. The artifact will be associated with the specified tenant ID. :param artifact_name: The name of the artifact to be downloaded. :type artifact_name: str :param tenant_id: The ID of the tenant associated with the downloaded artifact. :type tenant_id: str

Returns:

None