Stores progress in a file, useful for idempotent multi-step processes.
Project description
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()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file progress_keeper-0.1.3.tar.gz
.
File metadata
- Download URL: progress_keeper-0.1.3.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 033eeebef3a4b3d95ac1ef3f7ae55132020a1bca870910c1c9d2b0778612222d |
|
MD5 | b68b82455fe3be7e8e01097dbf1126d6 |
|
BLAKE2b-256 | f090a0d1b4a8c2af56b2e344bd1c27a581820b36573b05cac174592ea755b987 |
File details
Details for the file progress_keeper-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: progress_keeper-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d34fd451412c940ec6e4b4c1c541f95500e6d6b5bf7ba9c73c198ba9f8e133f1 |
|
MD5 | 4471c82b88f89ee5ee3e7ecc4f5ec6f7 |
|
BLAKE2b-256 | 0311ddea668f4ff18190885bd7ffcc73fef824b9fb447fb9c524de4b4e727d29 |