bh_utils.str_funcs module
Some string routines.
For usage examples, see ./tests/test_str_funcs.py.
- bh_utils.str_funcs.extract_session_cookie(cookie: str) str
From a string which might have multiple
name=valuepair strings, get the value forsessionname.name=valuepair strings are separated by semicolon (;). For example:csrftoken=7c4Df…zSEyl; session=6bdb9…kJcQs
session=84f32…uSWsc
- Parameters:
cookie (str) – a which contains multiple
name=valuepair strings.- Returns:
value for
sessionif 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.