This repository has been archived on 2020-10-14. You can view files and clone it, but cannot push or open issues or pull requests.
edt-parser/parser.py

30 lines
557 B
Python
Raw Normal View History

2020-09-20 20:53:24 +02:00
#!/usr/bin/env python
#-*- encoding: utf-8
import requests
from html.parser import HTMLParser
import caldav, icalendar
class GoogleSheetsParser(HTMLParser):
2020-09-20 20:55:27 +02:00
"""
Definition of a Google Sheets parser providing a table with each cell
and its position and size
"""
2020-09-20 20:53:24 +02:00
def handle_starttag(self, tag, attrs):
def handle_endtag(self, tag):
def handle_data(self, data):
2020-09-20 20:55:27 +02:00
# Getting the Google Sheet
2020-09-20 20:53:24 +02:00
2020-09-20 20:55:27 +02:00
# Parsing the Sheet
2020-09-20 20:53:24 +02:00
calParser = GoogleSheetsParser()
2020-09-20 20:55:27 +02:00
# Transforming the cells into events
# Pushing events to caldav server