import datetime from icalendar import Calendar, Event cal = Calendar() event = Event() event.add('summary', 'Team meeting') start = datetime.datetime(2021, 9, 1, 10, 0, 0) event.add('dtstart', start) end = datetime.datetime(2021, 9, 1, 11, 0, 0) event.add('dtend', end) cal.add_component(event) print(cal.to_ical())In this example, a new calendar is created using the Calendar class. An Event object is then created and added to the calendar using the `cal.add_component(event)` method. The Event object is assigned a summary using the `event.add('summary', 'Team meeting')` method, and its start and end dates and times are set using the `event.add('dtstart', start)` and `event.add('dtend', end)` methods, respectively. Finally, the `cal.to_ical()` method is called to generate the iCal data and print it to the console. Overall, the icalendar package provides a straightforward way to work with iCal data in Python.