bh_utils.str_funcs module

Some string routines.

For usage examples, see ./tests/test_str_funcs.py.

From a string which might have multiple name=value pair strings, get the value for session name.

name=value pair strings are separated by semicolon (;). For example:

  • csrftoken=7c4Df…zSEyl; session=6bdb9…kJcQs

  • session=84f32…uSWsc

Parameters:

cookie (str) – a which contains multiple name=value pair strings.

Returns:

value for session if found, otherwise --- No Cookie ---.

Return type:

str.

bh_utils.str_funcs.camel_case(s: str) str

Convert a string to camelCase.

Source: https://www.w3resource.com/python-exercises/string/python-data-type-string-exercise-96.php

Example:

``project-id`` converted to ``projectId``.  
``name`` to ``name``.
Parameters:

s (str) – source string to be converted.

Returns:

camelCase representation of source string.

Return type:

str.