plynx.utils.common

Common utils

Module Contents

plynx.utils.common.SearchParameter[source]
plynx.utils.common.SEARCH_RGX[source]
plynx.utils.common.TRUES = ['true', 't'][source]
plynx.utils.common.FALSES = ['false', 'f'][source]
plynx.utils.common.to_object_id(_id: Union[ObjectId, str, None]) → ObjectId[source]

Create ObjectId based on str, or return original value.

class plynx.utils.common.JSONEncoder[source]

Bases: json.JSONEncoder

Handles some of the built in types

default(self, o)[source]
plynx.utils.common.zipdir(path: str, zf: zipfile.ZipFile)[source]

Walk in zip file

plynx.utils.common.parse_search_string(search_string: str) → Tuple[Dict, str][source]

Separate keywords fro mserach string

plynx.utils.common.query_yes_no(question: str, default: str = 'yes') → bool[source]

Ask a yes/no question via input() and return their answer.

Args:
question (str): String that is presented to the user. default (str): ‘yes’ or ‘no’ default value

The ‘answer’ return value is True for ‘yes’ or False for ‘no’.

plynx.utils.common.str_to_bool(val: Union[str, bool]) → bool[source]

Convert string value to boolean

plynx.utils.common.update_dict_recursively(dest: Dict[Any, Any], donor: Dict[Any, Any]) → Dict[Any, Any][source]

Update dictionary in place