Textual Timepiece¶
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¶
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¶
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()