Skip to content

Textual Timepiece

PyPI - Version PyPI - Python Version GitHub Actions Workflow Status codecov

Welcome to the Textual Timepiece Documentation.


Textual Timepiece is a collection of widgets related to time management and manipulation. It includes various time and date pickers, an activity heatmap for displaying year dates and some extras.

Demo

Note

Requires uv to be installed and configured.

uvx --from textual-timepiece demo
pipx run textual-timepiece
pip install textual-timepiece && demo

Included Widgets

Widget Description
DatePicker A visual date picker with an input and overlay.
DurationPicker Visual duration picker with duration up to 99 hours.
TimePicker Visual time picker for setting a time in a 24 hour clock.
DateTimePicker Datetime picker that combines a date and time.
DateRangePicker Date range picker for picking an interval between two dates.
DateTimeRangePicker Range picker for picking an interval between two times.
DateTimeDurationPicker Pick an interval between two times, including a duration input.
Widget Description
ActivityHeatmap Activity Heatmap for displaying yearly activity similar to the GitHub contribution graph.
HeatmapManager Widget for browsing the Activity Heatmap with yearly navigation builtin.
Widget Description
DateSelect Date selection widget with calendar panes.
TimeSelect Time selection widget with various times in 30 minute intervals.
DurationSelect Duration selection widget with modifiers for adjust time or duration.
Widget Description
DateInput Date input which takes in a iso-format date.
TimeInput Time input that takes in 24 hour clocked in a HH:MM:SS format.
DurationInput Duration input with a duration up to 99 hours.
DateTimeInput An input with a combination of a date and time in iso-format.

Installation

pip install textual-timepiece
uv add textual-timepiece
poetry add textual-timepiece

Info

Requires whenever as an additional dependency.

Quick Start

DatePicker

DatePickerApp ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ 2025-03-10 ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ──────────────────────────────────────── March 2025 MonTueWedThuFriSatSun   1  2   3  4  5  6  7  8  9  10 11 12 13 14 15 16  17 18 19 20 21 22 23  24 25 26 27 28 29 30  31 ────────────────────────────────────────

from textual.app import App, ComposeResult
from textual_timepiece.pickers import DatePicker
from whenever import Date

class DatePickerApp(App[None]):
    def compose(self) -> ComposeResult:
        yield DatePicker(Date.today_in_system_tz())

if __name__ == "__main__":
    DatePickerApp().run()

DateTimePicker

DateTimePickerApp ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔    -  -     :  :   ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ──────────────────────────────────────────────────────────────────────────── HoursMinutesSeconds March 2025+1+4+15+30+15+30 -1-4-15-30-15-30 MonTueWedThuFriSatSun00:0000:3001:0001:30 02:0002:3003:0003:30   1  204:0004:3005:0005:30 06:0006:3007:0007:30   3  4  5  6  7  8  908:0008:3009:0009:30 10:0010:3011:0011:30  10 11 12 13 14 15 1612:0012:3013:0013:30 14:0014:3015:0015:30  17 18 19 20 21 22 2316:0016:3017:0017:30 18:0018:3019:0019:30  24 25 26 27 28 29 3020:0020:3021:0021:30 22:0022:3023:0023:30  31 ────────────────────────────────────────────────────────────────────────────

from textual.app import App, ComposeResult
from textual_timepiece.pickers import DateTimePicker
from whenever import SystemDateTime

class DateTimePickerApp(App[None]):
    def compose(self) -> ComposeResult:
        yield DateTimePicker()

if __name__ == "__main__":
    DateTimePickerApp().run()