ds_protocol_http_py_lib.utils ============================= .. py:module:: ds_protocol_http_py_lib.utils Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/ds_protocol_http_py_lib/utils/http/index /autoapi/ds_protocol_http_py_lib/utils/json_utils/index Functions --------- .. autoapisummary:: ds_protocol_http_py_lib.utils.find_keys_in_json Package Contents ---------------- .. py:function:: find_keys_in_json(json_data: dict[str, Any] | list[Any], target_keys: set[str]) -> str | None Recursively search for a set of keys in a nested JSON structure and return their value. :param json_data: The JSON data to search through. :param target_keys: A set of keys to search for. :returns: The value of the found key as a string, or None if no key is found. .. rubric:: Example >>> data = {"user": {"token": "abc123"}} >>> find_keys_in_json(data, {"token"}) 'abc123'