Skip to main content

Estimated time of availability calculator

Project description

estipy

Estimate time of availability of long running for loops.

Usage

import time
from estipy import ETA

# Some data to be processed
data = list(range(42))

for num, _ in ETA(data):
    # Do something useful here that takes a little time
    time.sleep(0.1)

# Example output:
# 13/42 = 31.0%, ETA Delta 0:00:02.685864, ETA 2021-07-04 14:50:12.486002

Try it online

Or disable auto print and access all eta data

for num, eta in ETA(data, auto_print=False):
    # Do something useful here that takes a little time
    time.sleep(0.1)
    print(eta.json(indent='  '))

# Example output:
# {
#   "total": {
#     "time": "0:00:03.762402",
#     "absolute": 42,
#     "percentage": 100
#   },
#   "remaining": {
#     "time": "0:00:02.956173",
#     "absolute": 33,
#     "percentage": 78.57142857142857
#   },
#   "done": {
#     "time": "0:00:00.806229",
#     "absolute": 9,
#     "percentage": 21.428571428571427
#   },
#   "eta": "2021-07-04 18:05:35.103308"
# }

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

estipy-0.0.4.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

estipy-0.0.4-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page