plynx.utils.common¶
Common utils
Module Contents¶
-
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.JSONEncoderHandles some of the built in types
-
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’.