jinks_widgets.calendar

This file contains the calendar widget class.

Functions

get_calendar_data(calendar_url[, days_ahead])

Get calendar data from the specified URL.

Classes

CalendarData(events, last_updated)

Data class for calendar widget data.

CalendarEvent(title, start_date, end_date, ...)

Data class representing a calendar event.

CalendarUpcoming()

Class defining the calendar widget which shows upcoming events from an Apple calendar.

class jinks_widgets.calendar.CalendarEvent(title, start_date, end_date, is_all_day)

Bases: object

Data class representing a calendar event.

title: str
start_date: datetime
end_date: datetime
is_all_day: bool
format_display_text(max_title_length=20)

Format the event for display with appropriate date formatting.

Return type:

str

__init__(title, start_date, end_date, is_all_day)
class jinks_widgets.calendar.CalendarData(events, last_updated)

Bases: object

Data class for calendar widget data.

events: List[CalendarEvent]
last_updated: datetime
classmethod from_ical_url(calendar_url, days_ahead=14)

Fetch and parse calendar data from an iCal URL.

Return type:

CalendarData

__init__(events, last_updated)
jinks_widgets.calendar.get_calendar_data(calendar_url, days_ahead=14)

Get calendar data from the specified URL.

Return type:

CalendarData

class jinks_widgets.calendar.CalendarUpcoming

Bases: object

Class defining the calendar widget which shows upcoming events from an Apple calendar.

It fetches data from an iCal URL and displays the next few events with appropriate date and time formatting.

width: int = 12
height: int = 6
color = 'BWG'
font_sizes = {40: 12}
classmethod data(calendar_url, days_ahead=14)

Get the upcoming calendar events.

Return type:

CalendarData

classmethod display(density, widget_data)

Render the calendar widget image showing upcoming events.

Return type:

Image