CaseInsensitiveDict#

class openfactory.kafka.CaseInsensitiveDict(dict=None, /, **kwargs)[source]#

Bases: UserDict

Dictionary with case insensitive keys.

Example

>>> d = CaseInsensitiveDict({'Content-Type': 'application/json'})
>>> d['content-type']
'application/json'
>>> d['CONTENT-TYPE']
'application/json'
get(key, default=None)[source]#

Retrieve the value associated with a key, case-insensitively, with a default.

Return type:

Any

Parameters:
  • key (str) – The key to look up.

  • default (Any, Optional) – Value to return if key is not found.

Returns:

Any – The value for the key, or default if not found.