disk_cache

czsc.utils.disk_cache(path: AnyStr | Path = PosixPath('/home/docs/.czsc'), suffix: str = 'pkl', ttl: int = -1)[source]

缓存装饰器,支持多种数据格式

Parameters:
  • path – 缓存文件夹父路径,默认为 home_path,每个函数的缓存文件夹为 path/func_name

  • suffix – 缓存文件后缀,支持 pkl, json, txt, csv, xlsx, feather, parquet

  • ttl – 缓存文件有效期,单位:秒