Getting rid of waste: manipulating calendars with Python and the ics library
In the city where I live, four different kinds of waste are collected regularly:
- paper,
- organic waste,
- the "yellow bag" which is for all sorts of packaging, and
- residual waste, which contains all the rest (except batteries, dangerous chemicals and a couple of other things, which people have to bring to collection facilities themselves).
At first sight, the days on which I have to take out the different bins and bags seem easy enough to remember: usually, everything is collected on the same day of the week. However, there are different schedules for the different kinds of waste (biweekly or every four weeks in my part of the city). Moreover, in weeks with bank holidays, the collection is often shifted to another weekday.
Fortunately, the city council provides iCalendar files (*.ical
) with all waste collection dates for the current year at its website. The downloaded file can easily be imported into any calendar application. I found that the structure of the events in the file could be made more convenient though.