# progress-keeper
This module is for keeping track of progress. It's useful for idempotent multi-part processes. If a process is interrupted or quits unexpectantly this can be used to keep track of the progress so that the next time the process is run, it can pick up where it left off.
## Install
```
pip install progress-keeper
```
## Usage
To create a progress object you need to define the following args:
- fp (str): file path of file to save progress into
- vars (list(str), optional): list of variables to include in progress file and keep track of. If undefined then it will assume only one var and use the default name - 'last_index_processed'.
When you create a progress object the module will check if the 'fp' exists and either use the values in that file if it does exist or create a new file (and set progress values to 0) if it does not exist.
```
fp = 'tmp/my-progress.cfg'
vars = ['process_abc','sub_process_a']
# create progress object
progress = Progress(fp, vars)
# increment progress 'var' by 1
progress.increment('process_abc')
# get value of progress 'var'
progress.values['progress_abc']
# reset value of progress
progress.reset('process_abc')
# delete progress file
progress.delete()
```
PyPI 官网下载 | progress-keeper-0.0.1.tar.gz
版权申诉
112 浏览量
2022-02-01
17:27:55
上传
评论
收藏 3KB GZ 举报
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
最新资源
- 一个chm格式的 SQL 函数手册-SQL语言手册文档
- 计算当前月份的天数和剩余天数
- 基于ARM的指令调度和延迟分支
- 基于Vue和TypeScript的极简聊天应用设计源码 - HasChat
- 基于Vue2全家桶和Zcool数据的图片收集网站设计源码 - cool-picture
- 基于C和C++的二维绘制工具设计源码 - DrawPro
- Object.defineProperty 的 IE 补丁object-defineproperty-ie-master.zip
- 整卷预览.mhtml
- MySQL是一种广泛使用的开源关系型数据库管理系统,它提供了丰富的SQL语句用于数据库的创建、查询、更新和管理 以下是一些常见的
- MySQL是一种广泛使用的开源关系型数据库管理系统,它提供了丰富的SQL语句用于数据库的创建、查询、更新和管理 以下是一些常见
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈