Defines various storage engines for the MAB
interface
-
class flask_mab.storage.BanditDecoder(encoding=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)[source]
Bases: json.decoder.JSONDecoder
Json Marshaller for Bandits
-
decode(obj)[source]
-
class flask_mab.storage.BanditEncoder(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, encoding='utf-8', default=None)[source]
Bases: json.encoder.JSONEncoder
Json serializer for Bandits
-
default(obj)[source]
-
class flask_mab.storage.BanditStorage[source]
Bases: object
The base interface for a storage engine, implements no-ops for tests
-
flush()[source]
-
load()[source]
-
save(bandits)[source]
-
class flask_mab.storage.JSONBanditStorage(filepath)[source]
Bases: flask_mab.storage.BanditStorage
Json based file storage
Saves to local file
-
flush()[source]
-
load()[source]
-
save(bandits)[source]