Skip to main content
Help us improve Python packaging – donate today!

This python module aids in estimating how long some long running process will require until it completes.

Project Description


This python module aids in estimating the remaining time of a (long running) process. For that purpose it provides the following class: * TimeEstimation

How to Use the Time Estimation Class

In order to use the time estimation class first create a properly initialized instance. You at least have to tell the object how many processing steps you will have. (This information is required in order to be able to calculate the remaining time during processing.)


`python # initialize the time estimation object te = TimeEstimator(PROCESS_DURATION_STEPS, 0, 5, 5) `

The arguments have the following meaning:

  1. (required) The maximum number of steps your task will require.
  2. (optional) The current position. This will be interesting for you if you resume processing and therefor start at a specific position and not at zero.
  3. (optional) The minimum number of seconds we want to have data collected until we can do a reasonable estimation.
  4. (optional) The minimum number of data values we want to have collected until we can do a reasonable estimation.

Then - during processing - call tick() whenever you completed a processing step.

`python # inform the estimation object that we did something te.tick() `

In order to estimate the remainig time call getETAStr() and print the result.


`python # estimate remaining time and print it print(te.getETAStr()) `

Estimation Output

The method getETAStr() provides the following arguments:

  • EnumTimeEstimationOutputStyle mode : Select the output mode. (See below.)
  • bool bSmooth : This value is True by default and therefor enables smoothing by default. (See below.)
  • str default : A default string to output if no time estimation can be given (yet). Here None is the default.

This method supports the following estimation output styles:

  • EnumTimeEstimationOutputStyle.EASY : Print either something like “X days Y hours” or something like “HH:MM:SS”
    indicating hours, minutes and seconds. (This is the default.)
  • EnumTimeEstimationOutputStyle.FORMAL : Print the remaining time in a strict format: “DD:HH:MM:SS”

Smoothing will result in averaging over the last 20 estimation values calculated. This is a very simple implementation but it works quite well and reduces fluctuations of values if the individual processing steps vary too much in their duration.

Contact Information

This is Open Source code. That not only gives you the possibility of freely using this code it also allows you to contribute. Feel free to contact the author(s) of this software listed below, either for comments, collaboration requests, suggestions for improvement or reporting bugs:


Apache Software License 2.0

Release history Release notifications

History Node


This version
History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
jk_timest-0.2017.1.12.tar.gz (8.3 kB) Copy SHA256 hash SHA256 Source None Jan 12, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page