Skip to main content
This is meant to be a super simple drop in for tracking progress.

This is, in essence, a wrapper around [progressbar2][1] with my personally
preferred defaults and ways of doing things.

If you need anything even slightly more complicated than what EtaTimer
provides, I recommend looking at the progressbar2 module instead.

[1]: https://github.com/WoLpH/python-progressbar

# Quickstart
from etatimer import EtaTimer
import time

x = range(5)
t = Timer(len(x))
for i in x:
t.tick()
time.sleep(1)

# Classes

### `EtaTimer(total, name="", stream=sys.stdout)`
Create a simple ETA Timer named `name` that tracks `total` number of operations
and prints updates to the stream `stream`.

### `DummyEtaTimer()`
Timer that supports same API as EtaTimer, but does nothing. Allows for code
that must always pass a timer, but doesn't always have information needed for
creating an EtaTimer.

Example: If a file is not seekable, we can't determine the number of lines.

if infile.seekable():
timer = ETATimer(sum(1 for i in infile))
infile.seek(0, 0)
else:
timer = DummyTimer()
process_file(infile, timer)

# API

### `timer.tick()`

Mark that one processing item has been completed.

If all items are processed, ding() will be automatically called.

The timer can be stopped early through manual calling of ding()

Can be used as an arbitrary callback function. Will accept and ignore any
number of parameters.

### `timer.ding()`

Timer's done!

Prints final statistics.

### `timer.finished`

Boolean indicating if time is finished.

Metadata

Release files for etatimer 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for etatimer 1.0.0
File Size Uploaded Provenance Actions
etatimer-1.0.0.tar.gz 4.3 kB Without provenance Details for etatimer-1.0.0.tar.gz

Release files / etatimer-1.0.0.tar.gz

Download URL etatimer-1.0.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ba31153f306c83bbb104d7dc61c6bf6882e71fb1dbe38ea40e82d7ac9ceff781
BLAKE2b-256 checksum
How to use checksums
1b3cf2862f8c606d3cc6bc9682bd99a96aa3028837c717a5724ee86036f4ac0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for etatimer 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page