Giter Club home page Giter Club logo

ical2paleventfile's Introduction

ical2paleventfile

'pal' is a command-line calendar on unixoid systems - it's really small and fast, especially when you work with the console a lot to begin with. Most of us keep their calendars on some online service today, though, so synchronisation to pal is a bit of pain.

This little script converts an ical to a pal-compatible eventfile

Screenshot

License

This script is licensed under the GPLv3 or later.

Requirements

  • Python 3
  • ics 0.4 or later (--> pip install ics)

Installation

1. Download this repository

2. Install the script

This script installs into /usr/local/bin - on most Linux distributions, that a directory that is included into the $PATH, so you should be able to run ical2paleventfile from anywhere in your cli.

sudo make install

3. Create the configuration

ical2paleventfile needs a configuration file under ~/.ical2paleventfile/calendars.conf. This file must be manually created by you.

$ mkdir ~/.ical2paleventfile
$ pico ~/.ical2paleventfile/calendars.conf

In this file, you need to add a section for every ical file you want to syncronize down to pal. A section follows this structure:

[calendar0815]   # Make sure the section name is different for every calendar. Only alphanumerical characters, no spaces!
url = [URL of the ICS file - escape % with %%]
palname = [output pal event filename] # always in your userdir under ~/.pal
name = [name of the calendar]
shorthand = [2-character shortcode]

So, for example, this may look like the following:

[myCalendar]
url = http://www.example.com/myCalendar.ics
palname = mycalendar.pal
name = my personal calendar
shorthand = mc

You can add as many sections as you like. If you want to deactivate a section, you can comment out all lines related to it by adding a # in front of it.

4. Run ical2paleventfile for the first time.

This is a good time to start ical2paleventfile for the first time so calendars can be downloaded.

$ ical2paleventfile

There now should be pal event files in ~/.pal/ corresponding to your configuration.

5. Make pal aware of the new file

$ pico ~/.pal/pal.conf

For each calendar file you have just created, add a new line in the form

file mycalendar.pal

You can use colours to distinguish between calendars later

file mycalendar.pal (red)

6. (optional) Make sure the script runs regularily

ical2paleventfile only runs when you allow it to run. You may want to create a cronjob for it, or to add it to your ~/.profile script.

ical2paleventfile's People

Contributors

mhohenberg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

ical2paleventfile's Issues

Error

Hi Martin,

I spoke to you a while ago about setting up my calendars and everything was working fine (and still is for some machines). However, for one I have the following error. I have tried reinstalling but that does not solve the issue. The error that I have is

url: https://calendar.google.com/calendar/ical/robohay%40gmail.com/private-3dbda6130d9a25dd38d5ef3ac13755d8/basic.ics
pal: /home/rob/.pal/myfile.pal
calendar name: MC MyCalendar
UnicodeEncodeError
UnicodeEncodeError
UnicodeEncodeError
UnicodeEncodeError
UnicodeEncodeError
Traceback (most recent call last):
  File "/home/rob/bin/ical2paleventfileSTOP", line 36, in <module>
    url = parser.get(section, "url")
  File "/usr/lib/python2.7/ConfigParser.py", line 623, in get
    return self._interpolate(section, option, value, d)
  File "/usr/lib/python2.7/ConfigParser.py", line 691, in _interpolate
    self._interpolate_some(option, L, rawval, section, vars, 1)
  File "/usr/lib/python2.7/ConfigParser.py", line 732, in _interpolate_some
    "'%%' must be followed by '%%' or '(', found: %r" % (rest,))
ConfigParser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%2FLondon'

This suggests something about the characters but that does not make sense to me because it works on another machine.

Do not export before/after date

Some google calendar files are surprisingly large and go back many years. There should be a way to limit how far in the past events are created - either with a fixed date, or with a variable length

Also offer this for future events.

Default to "all"

Error

Hello,

Just in case you are still keeping this up... I have an error message trying to convert a google ics holidays calendar for Ivory Coast. This is using Python 3.10.0rc2 on Fedora 35.

This file downloads fine: https://calendar.google.com/calendar/ical/fr.ci%23holiday%40group.v.calendar.google.com/public/basic.ics

But causes an errro with ical2palevent:

[bkelly@toolbox Downloads]$ ical2paleventfile /usr/local/bin/ical2paleventfile:35: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead. parser = SafeConfigParser() Traceback (most recent call last): File "/usr/local/bin/ical2paleventfile", line 39, in <module> url = parser.get(section, "url") File "/usr/lib64/python3.10/configparser.py", line 800, in get return self._interpolation.before_get(self, section, option, value, File "/usr/lib64/python3.10/configparser.py", line 395, in before_get self._interpolate_some(parser, option, L, value, section, defaults, 1) File "/usr/lib64/python3.10/configparser.py", line 442, in _interpolate_some raise InterpolationSyntaxError( configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%23holiday%40group.v.calendar.google.com/public/basic.ics'

[bkelly@toolbox .ical2paleventfile]$ \cat calendars.conf [ci] url = https://calendar.google.com/calendar/ical/fr.ci%23holiday%40group.v.calendar.google.com/public/basic.ics palname = ci.pal name = jours fériés en Côte d'Ivoire shorthand = ci

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.