A simple abstraction for computing and formatting time estimates.
Project description
ETA Utility
A simple abstraction for computing and formatting time estimates.
Basic Usage
import time, random
from etautil import Eta
def process_item(item):
# Just a placeholder function that takes a random amount of time
time.sleep(random.random() * 5)
item_count = 10000
print(f"Processing {item_count} items...")
eta = Eta(item_count) # Starts keeping time now
for item in range(item_count):
print(eta.progress_string(item)) # Print the current progress stats
process_item(item)
print(f"Done processing {item_count} items in {eta.time_taken_string()}!\n")
Here is an example of the sort of output this produces:
...
1.59% | 38M:43S | 3:34:32 PM
1.60% | 38M:43S | 3:34:32 PM
1.61% | 38M:43S | 3:34:32 PM
1.61% | 38M:42S | 3:34:32 PM
1.62% | 38M:42S | 3:34:32 PM
1.63% | 38M:42S | 3:34:32 PM
1.64% | 38M:42S | 3:34:32 PM
1.65% | 38M:42S | 3:34:32 PM
1.65% | 38M:42S | 3:34:32 PM
1.66% | 38M:42S | 3:34:32 PM
...
You can get more verbose information by doing:
eta = Eta(item_count, verbose=True)
Here is an example of the verbose output:
...
2.10% (264/12518) | Time remaining: 39 minutes and 25 seconds | ETA: 3:40:33 PM
2.11% (265/12518) | Time remaining: 39 minutes and 25 seconds | ETA: 3:40:33 PM
2.12% (266/12518) | Time remaining: 39 minutes and 25 seconds | ETA: 3:40:33 PM
2.13% (267/12518) | Time remaining: 39 minutes and 24 seconds | ETA: 3:40:33 PM
2.13% (268/12518) | Time remaining: 39 minutes and 24 seconds | ETA: 3:40:33 PM
2.14% (269/12518) | Time remaining: 39 minutes and 24 seconds | ETA: 3:40:33 PM
2.15% (270/12518) | Time remaining: 39 minutes and 23 seconds | ETA: 3:40:32 PM
2.16% (271/12518) | Time remaining: 39 minutes and 23 seconds | ETA: 3:40:32 PM
2.17% (272/12518) | Time remaining: 39 minutes and 23 seconds | ETA: 3:40:32 PM
2.17% (273/12518) | Time remaining: 39 minutes and 23 seconds | ETA: 3:40:32 PM
...
Each individual property and text field is accessible via public methods.
Full Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
etautil-2.2.0.tar.gz
(15.3 kB
view details)
Built Distribution
etautil-2.2.0-py3-none-any.whl
(15.9 kB
view details)
File details
Details for the file etautil-2.2.0.tar.gz
.
File metadata
- Download URL: etautil-2.2.0.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7666f55fcdcb7349fe99885d0af4f2dba5f7c9864f43ce49acd2b879ca300d58 |
|
MD5 | a2d630051aa2bca66d44ede40e8db5d6 |
|
BLAKE2b-256 | 0346b139bf77d0bb856623801b9422a486898deee53e6fb4a7b4071585b9bfa4 |
File details
Details for the file etautil-2.2.0-py3-none-any.whl
.
File metadata
- Download URL: etautil-2.2.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92bd8c13bea97dc16d777d2cfe26478e770b9abaf2630d87d25366ab9960789d |
|
MD5 | b15941b3d35362233d611a5a835eb1fb |
|
BLAKE2b-256 | 65be58c481a32547b441601bdc8dd6d9d9f43c541c623d27138ee2230f50ca25 |