ObjectService#

class sigtech.framework.services.strategy_service.service.ObjectService

Object cache service to persist a picklable object in s3 for the purpose of sharing between users, as well as saving objects into relatively durable storage.

Objects are stored in s3 in a zlib compressed pickle format.

property is_active: bool

Service is active

get(key: str) Optional[pandas.core.frame.DataFrame]

Get key from service, returns None if it doesn’t exist

put(key: str, df: object, expires: Optional[str] = '30d')

Put an object into the service, identified by key

keys(key_prefix: str) Sequence[str]

Get all keys in service with this prefix

delete(key: str)

Delete key

exists(key: str) bool

Key exists

list_keys(filter_by_environment: bool = False) Sequence[str]

Return a list of all keys :param filter_by_environment: filter keys to those generated in the same environment :return: list of keys