30 lines
557 B
Python
Executable File
30 lines
557 B
Python
Executable File
#!/usr/bin/env python
|
|
#-*- encoding: utf-8
|
|
|
|
import requests
|
|
from html.parser import HTMLParser
|
|
import caldav, icalendar
|
|
|
|
|
|
class GoogleSheetsParser(HTMLParser):
|
|
"""
|
|
Definition of a Google Sheets parser providing a table with each cell
|
|
and its position and size
|
|
"""
|
|
def handle_starttag(self, tag, attrs):
|
|
|
|
def handle_endtag(self, tag):
|
|
|
|
def handle_data(self, data):
|
|
|
|
|
|
# Getting the Google Sheet
|
|
|
|
|
|
# Parsing the Sheet
|
|
calParser = GoogleSheetsParser()
|
|
|
|
# Transforming the cells into events
|
|
|
|
# Pushing events to caldav server
|