cpl_core.utils

cpl_core.utils.credential_manager

class cpl_core.utils.credential_manager.CredentialManager

Bases: object

Handles credential encryption and decryption

static build_string(string: str, credentials: str)

Builds string with credentials in it

string: str

String in which the variable is replaced by credentials

credentials: str

String to encode

Decoded string

static decrypt(string: str) str

Decode with base64

string: str

String to decode

Decoded string

static encrypt(string: str) str

Encode with base64

string: str

String to encode

Encoded string

cpl_core.utils.pip

class cpl_core.utils.pip.Pip

Bases: object

Executes pip commands

classmethod get_executable() str
classmethod get_outdated() bytes

Gets table of outdated packages

Bytes string of the command result

classmethod get_package(package: str) Optional[str]

Gets given package py local pip list

package: str

The package name as string

classmethod install(package: str, *args, source: Optional[str] = None, stdout=None, stderr=None)

Installs given package

package: str

The name of the package

args: list

Arguments for the command

source: str

Extra index URL

stdout: str

Stdout of subprocess.run

stderr: str

Stderr of subprocess.run

classmethod reset_executable()

Resets the executable to system standard

classmethod set_executable(executable: str)

Sets the executable

executable: str

The python command

classmethod uninstall(package: str, stdout=None, stderr=None)

Uninstalls given package

package: str

The name of the package

stdout: str

Stdout of subprocess.run

stderr: str

Stderr of subprocess.run

cpl_core.utils.string

class cpl_core.utils.string.String

Bases: object

Useful functions for strings

static convert_to_camel_case(chars: str) str

Converts string to camel case

chars: str

String to convert

String converted to CamelCase

static convert_to_snake_case(chars: str) str

Converts string to snake case

chars: str

String to convert

String converted to snake_case

static first_to_lower(chars: str) str

Converts first char to lower

chars: str

String to convert

String with first char as lower

static first_to_upper(chars: str) str

Converts first char to upper

chars: str

String to convert

String with first char as upper

static random_string(chars: str, length: int) str

Creates random string by given chars and length

String of random chars