Skip to content

Instantly share code, notes, and snippets.

@janseeger
Last active April 30, 2017 12:45
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 janseeger/4d05d0424ca940cade45fc81c4f2c61b to your computer and use it in GitHub Desktop.
Save janseeger/4d05d0424ca940cade45fc81c4f2c61b to your computer and use it in GitHub Desktop.
Small script that extracts all calendar events from a Baikal (http://sabre.io/baikal/) database and writes them into separate files.
#!/usr/bin/python
import sqlite3
conn = sqlite3.connect("db.sqlite")
c = conn.cursor()
for row in c.execute("SELECT calendardata,uri FROM calendarobjects"):
f = open(row[1], "wb")
data = row[0].encode("UTF-8")
f.write(data + "\n")
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment