Skip to main content

term-clock

A digital clock for the terminal. It shows hh:mm:ss, stays on the wall-clock second, and grows to fill the window.

Works over SSH the same way it works locally: alternate screen, no flicker, CTRL+C returns you to the prompt.

Install

pip install term-clock-app

The PyPI name is term-clock-app because term-clock / termclock is already taken. The command you run is still term-clock.

From a clone:

pip install -e .

Python 3.9 or newer. No runtime dependencies.

Run

term-clock
# or
python -m term_clock
term-clock --padding 1 --spacing 2          # defaults
term-clock --padding 2 --spacing 4
term-clock --hour-format 12
term-clock --hour-format 24

Press CTRL+C to quit.

Options

Flag Default Meaning
--padding N 1 Blank rows and columns on every side
--spacing N 2 Blank columns between digits
--hour-format {12,24} system clock, or 24 12-hour with AM/PM, or 24-hour

The default hour format follows the environment's time locale (LC_TIME / T_FMT) when that can be read. If it cannot, the clock uses 24-hour.

Display

  • 7 or fewer lines: a plain text clock, centred.
  • 8+ lines: large seven-segment digits drawn with full blocks █ for horizontal and vertical bars, and the four triangles ◤ ◥ ◣ ◢ for 45° corner cuts (one column per row — never sampled, never an off-angle diagonal). They grow to fill the window (each axis stretched by at most 1.5× before the rest becomes centring margin). If the window is too small for a readable clock, it falls back to the text version.
  • Colons: two small axis-aligned blocks (no diagonals), centred, spanning at most one third of the digit height.
  • 12-hour: AM or PM sits to the right of the digits.
  • Timing: after each flip the process sleeps until the next wall-clock second, then measures how late or early it woke (target: within 2 ms) and shortens or lengthens the following sleep. A resize is picked up on the next second. Unchanged cells are not rewritten.

Develop

pip install -e ".[dev]"
pytest

Pure rendering lives in term_clock/core.py (unit-tested). The terminal loop is in term_clock/cli.py.

See DESIGN.md for the design and the TDD log.

License

MIT. See LICENSE.

Metadata

Release files for term-clock-app 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 term-clock-app 1.0.0
File Size Uploaded
term_clock_app-1.0.0.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for term-clock-app 1.0.0
File Interpreter ABI Platform
term_clock_app-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.5 kB

Release files / term_clock_app-1.0.0.tar.gz

Download URL term_clock_app-1.0.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d85ef474d432d8ffd01a111b4b6fdb60c54e6cb9cef1dbe5658d5f2425a825bc
BLAKE2b-256 checksum
How to use checksums
b3609cff29e436c962f72832f4a6a69d957d81378e866335b3ecba4d457d65d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / term_clock_app-1.0.0-py3-none-any.whl

Download URL term_clock_app-1.0.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3cd82b10742d9763b8d0b9438f9c8438d2f20a658864e82aed8cc7a2a3e4896c
BLAKE2b-256 checksum
How to use checksums
e236ecffdb04439db84919f7c75f94d2e23bea9c7a1b7e1e31363064ea5d4d06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

1.2.0

2 release files

1.1.0

2 release files

This release

1.0.0 This release

2 release files

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