Fill and sync Google Calendars with events taken from a Google spreadsheet
Project description
What is does
Fill Google Calendars with events generated reading a sheet taken from a Google Spreadsheet.
How to install
pip install haunts
Prerequisites
To use Google Calendar and Google Spreasheet APIs you must generate a Google API application and download a credentials.json. This file must be put inside the ~/.haunts directory (this will be generated automatically, see below).
See https://cloud.google.com/docs/authentication/getting-started
How to use
Command line help is accessible using:
haunts --help
Usage
haunts <SHEET_NAME>
The first time haunts will be run, it just create an .haunts folder in your home directory with configuration files inside, then it exits. You must edit the ~/.haunts/haunts.ini file.
Following run attempts will work normally.
You can also limits events interaction to a single day, or a set of days by using the -d parameter (can be used multiple times):
haunts --day=2021-07-08 <SHEET_NAME>
How it works
The command will try to access a Google Spreatsheet you must own (write access required), specifically it will read a single sheet inside the spreadsheet.
Month sheet definition
The referenced sheet must contains a set of columns (with headers defined below) but orders matters not. Also: additional columns can be added and they will be ignored.
The partition in multiple sheets is designed to keep every month in a separate sheet, but this is not strictly checked.
Sheet format should be:
- Date
(date)
The day where the event will be created
- Spent
(number)
How long the event will last
- Project
(number)
Project name (see below)
- Activity
(string)
Summary of the event
- Details
(string, optional)
Additional text for the event description
- Event id
(string)
Leave this empty. It will be filled with the id of the generated event
- Link
(text)
Leave this empty. It will be filled with a link to the event inside Google Calendar. Put an I manually if you want to ignore an entry and avoid event creation.
- Action
(char)
See below. If emtpy: it will be filled with an I when an event is created
Configuring projects
The spreadsheet must also contains a configuration sheet (default name is config, can be changed in the .ini) where you must put two columns (with headers):
- id
The id of the Google Calendar associated to this project. You must have write access to this calendar.
- name
The name of the project, like an alias to the calendar
A project name can be associated to the same calendar id multiple times.
Values in the name columns are the only valid values for the Project column introduced above
How events will be filled
Let says you run something like this:
haunts --day=2021-07-08 July
haunts will access the sheet named July in the spreadsheet configured in the .ini file. Only rows where the Date filed will match the --day parameter will be considered.
For every rows that match, haunts will:
Generate a new event, starting from a default time (this can be configured in the .ini). The event will last for Spent hours
The next event will start where the previous ended
If the event will be successfully created, an I will be placed in the Action column. This will make other execution of haunts to ignore the line.
Other columns will be read or filled as described above.
TODO and known issues
Rows in the momth sheets must be sorted ascending
Other actions maybe? Like E (for edit)
haunts will not check for already filled time slots, so overlapping of events may happens
Why?!
In B-Open this is how we register our worklogs, participation to projects in multiple Google Calendars.
OK, but why “haunts”?!
An haunt is a monster from Dungeond&Dragons, which was translated to italian as “Presenza”.
But “presenza” is the same term used in italian for “participation”, so how we call our worklogs.
And filling worklogs haunt us.
Credits
Developer and contributors.
keul <l.fabbri@bopen.eu> (main worklogs hater)
History
0.1.0 (2021-07-10)
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for haunts-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0199ef95d1ffcfc2fddc644e9ea48a7f91b45310550b163bfc811f0f3ca2353e |
|
MD5 | 42211cf1e09e378849333e7d2600281d |
|
BLAKE2b-256 | 7e4adae194201a41f96a2f48b27d8cbda471ae9f13583970b1b8992826337a93 |