A library of tools for tracking, computing, and formatting time estimates.
Project description
ETA Utility
A library of tools for tracking, computing, and formatting time estimates.
Basic Usage
import time, random
import etautil
# Just a placeholder function that takes a random amount of time
def process_item(item):
time.sleep(random.random() * 5)
eta = None # Initialize here so we can use it later
for item, eta in etautil.eta(range(100)):
print(eta) # Print the current progress stats
process_item(item)
print(f"Done processing {eta.total_items} items in {eta.time_taken_string()}!\n")
Here is an example of the sort of output this produces:
...
1.59% | 0:38:43 | 3:34:32 PM
1.60% | 0:38:43 | 3:34:32 PM
1.61% | 0:38:43 | 3:34:32 PM
1.61% | 0:38:42 | 3:34:32 PM
1.62% | 0:38:42 | 3:34:32 PM
1.63% | 0:38:42 | 3:34:32 PM
1.64% | 0:38:42 | 3:34:32 PM
1.65% | 0:38:42 | 3:34:32 PM
1.65% | 0:38:42 | 3:34:32 PM
1.66% | 0:38:42 | 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.4.0.tar.gz
(16.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
etautil-2.4.0-py3-none-any.whl
(17.6 kB
view details)
File details
Details for the file etautil-2.4.0.tar.gz.
File metadata
- Download URL: etautil-2.4.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3626b16080e48e3acf1dcee76a567cbe5735e3bb6ebca7efd7fea4cb5b06d3cb
|
|
| MD5 |
2720f8f3b5c10b28985b8c6fbba45389
|
|
| BLAKE2b-256 |
fce6c1fba3f5757161f6ef5623e3a4b29da5179d78fa6182ccbdd7e0abf089dd
|
File details
Details for the file etautil-2.4.0-py3-none-any.whl.
File metadata
- Download URL: etautil-2.4.0-py3-none-any.whl
- Upload date:
- Size: 17.6 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 |
f5e0820ac7f561f63a18438545bdd0390581c4e7da6ec3c30c49d2e28292f857
|
|
| MD5 |
067549922df746a94e4e0e20cdeab20a
|
|
| BLAKE2b-256 |
6377ccea64813d4e3076903da87c262d404bb17cdf301b99da87fb917e7b2d96
|