Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oleks/calwerk

Query the number of busy hours in ics calendars
https://github.com/oleks/calwerk

Last synced: 20 days ago
JSON representation

Query the number of busy hours in ics calendars

Awesome Lists containing this project

README

        

+=======+
| Intro |
+=======+
Have you ever thought of noting your working hours in google calendar, but
haven't had a decent way to export it? Well, that's why I've put together
this quick python script.
+======+
| Desc |
+======+
Basically it caculates the number of busy hours and days within a given
time-frame presented behind a url to an ics file.
+=======+
| Usage |
+=======+
(in the following a '>' symbolises a prompt)

Run the program simply by using your regular python shell command:

> python calwerk.py

Where you replace '' with your own url (not containing spaces,
otherwise remember the double-quotes around). The most practical here are
your private calendar urls in your Google
Calendar(http://www.google.com/support/calendar/bin/answer.py?hl=en&answer=37648),
if you're into that sort of thing.

As a result, you are presented with a title to a table containing all the
dates on which you were busy, as well as the duration of those events. If
you were busy several times during the day, those represented as seperate
rows in the table, but still in chronological order. As the footer of that
table you get the total number of days that you were busy, and the total
number of hours.

You can also do the aforementioned for several csv files at once, if you,
for example, are working two jobs at once:

> python calwerk.py ..

Where ".." represents a finite number of other 's.

Of course, this script wouldn't be complete without the ability to do this
between several dates. For this there are (both optional) start and end
date attributes prefixed by 's:' and 'e:' respectively:

> python calwerk.py s:dd-MM-yyyy e:dd-MM-yyyy

Here you must provide the dates in the mentioned format, i.e.
'e:19-03-2010'. This will result in a table containing events the occured
on either the start-, enddate or a date in between them.

Of course, since you can read several urls, you can also limit several
reads, precisely like this:

> python calwerk.py e:19-03-2010 s:15-03-2010 ..

Then, the script will use the same limit for all of the urls(notice how the
order of the start/end date combination does not matter), untill overriden,
like this:

> python calwerk.py s:15-03-2010 s:19-03-2010

However, you MUST provide the limits before the calendar, if you want the
output limited.
+=======+
| Outro |
+=======+
Of course, most of us have the same calendar to look up every month before
we hand in our work sheet, so feel free to branch and hard-code the urls to
read!