Forum Archive

How to get Reminders of Specific Calendars

jmnickerson

Howdy folks,

I just started messing around with the reminders module, and I cannot figure out how to get all the reminders for a specific calendar or how to get the Calendar for specific reminders.

I don't see any reference to how to do this in the documentation (http://omz-software.com/pythonista/docs/ios/reminders.html#reminders.Calendar), and inspecting Calendar and Reminder objects also seems fruitless.

Relationships between the reminders/calendars is a pretty central concern so this seems like a huge omission.

Does the reminders module truly omit this or am I missing something obvious?

pulbrich

Did you try this?

reminders.get_reminders(calendar=None, completed=None)

Return all reminders in the given Calendar (or all calendars). Seems exactly what you are looking for.

mikael

@jmnickerson, to find a specific calendar to use in the above, you need to do something like the following:

    all_calendars = reminders.get_all_calendars()
    for calendar in all_calendars:
        if calendar.title == my_cal_name:
            my_calendar = calendar
            break
jmnickerson

@pulbrich Oh ok. Party. That looks like just what I needed. Thanks 👌👍

Something like this does the trick then.

cals = {cal.title: reminders.get_reminders(calendar=cal,  completed=False) for cal in
reminders.get_all_calendars()}
jmnickerson

@mikael

Cool. Thanks for this 👍