Skip to content

Instantly share code, notes, and snippets.

@ncuesta
Created May 11, 2013 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ncuesta/5560636 to your computer and use it in GitHub Desktop.
Save ncuesta/5560636 to your computer and use it in GitHub Desktop.
Ejemplo de uso de icalendar en Python
#
# Ejemplo (acotado) de uso de icalendar
#
import icalendar
from datetime import date
# Creo un evento
event = icalendar.cal.Event()
# Especifico la fecha de inicio
event.add('dtstart', date(2013, 8, 9))
# Expecifico que es un evento recursivo cada 1 año
event.add('rrule', { 'freq': 'yearly', 'interval': 1 })
print event.to_ical()
# =>
# BEGIN:VEVENT
# DTSTART;VALUE=DATE:20130809
# RRULE:FREQ=YEARLY;INTERVAL=1
# END:VEVENT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment