-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ICS files #4
Comments
I looked into it, indeed the database could be in .ics and the file could be synced for example using Also, not all entries seem to be so universal. Nextcloud for example writes Then, it's also not clear to me how to manage todo tasks. Should they be in the same file, in a different file, or each in a different file. p.s. I am new to this system, so maybe I just don't get it... |
My events are in Google Calendar and I want to see them in this app. |
If I may add to this feature request the option to add these from the commandline. I am using aerc for emails and it would be great to just do something like piping it into calcure or providing it with a |
I started looking into this issue, it seems like the easiest and most supported way to go is ics.py library. However, in addition to the problems mentioned above, I discovered several more problems:
In conclusion, while last two points are doable, the first two points are somewhat critical, because if numerous devs of the ics library couldn't figure it out in many years, I probably won't be able to quickly fix it by myself. So I am still looking for some easy and compatible way to import/export the events to ics. |
Khal uses the icalendar library with some helper functions which might provide some inspiration. I do think that ics support is pretty vital given almost all other calendar systems support it (e.g. if I want to sync events to my phone and my nextcloud, at the moment this is all done with ics files and caldav). I use khal currently, which is great, but I'm always keen to see nice TUI programmes for this sort of thing. |
Thank you, I'll look into the khal example! |
Hello, I am just here to support the request and give a little more perspective. Currently I use Khard, Khal and Todoman, using files in vdir folders. Most of the people who want a CLI or TUI stack with open and proper protocols, are on these tools. One tool for each feature, all connected to each other. Perfect. This is one of the few combinations that works at the moment if you want to replace what a closed ecosystem or a GUI like Gnome/Evolution can do. But we have 3 major problems that got stuck for years:
As a result, things that work on my phone or on Evolution are not available in my terminal. I was disappointed with Calcurse, which is useless, as it can only import one calendar and only supports a third of the basic VTODO fields. For the moment my hopes are on Calcure, I will try to invest time here. Honestly, if this project manages to be compatible with caldav or vdir, and propose a dozen VTODO fields. A lot of people will rush here. |
Thank you for the details. I agree it would be great but I still don't see any easy way to do it. As far as I can see from calcurse experience, they implemented that several years ago, but it is not finally very usable, like you said some fields are missing, and their issue section is filled with bags related to caldav. For anyone willing to contribute with caldav support:It would be very helpful is somebody could write a simple working example of import/export from a folder of real ics files (not just a link to the docs please, I read the docs for all these libs.). Let's start with tasks. Please take several todo files (more than one), each must have a few mandatory fields like DESCRIPTION, STATUS, DUE plus a few fields that remain unused (like they are unsupported). The minimal working example should read these files, and save fields for each file into some variables, change something, and export back into original files. Fields originally present in the files, but not imported, should not be lost. Thank you for your interest to the project :) p.s. at the moment, I am not 100% convinced that full support of ics is possible, but I think at least the ability to only display events/tasks from ics must be implemented. |
Thank you, I will contribute. I already have some informations that I wrote recently. I hope something help. At the bottom, I added a small analysis of a folder with VEVENT and VTODOs. When I got the time I will make a better one from more sources and with other fields. ANALYSIS OF SOME TOOLS THAT I USE OR USED
Result : The easiest way to work with ICALENDAR on Linux without CALDAV implementation.
Result: Powerful and clean php library respecting standard RFC 5545 for ICALENDAR.
Result: Powerful, modern and extensive libraries but messy as a reference and in Java.
Result: Not really a library reference but a good choice of limited features and good ICALENDAR export example. Nextcloud Calendar/Tasks
Result: Largely used today, compatibility need to be tested. Gnome/Evolution
Result : A good bench because it work with every ICALENDAR sources and probably most features. RESULTS:
ANALYSIS OF A CALENDAR EVENT ASSOCIATED WITH A TASK AND 2 SUB-TASKS The tasks where created on android with Tasks. Then related to an event on the ETAR calendar app. I get a folder for my calendar with 6 files:
DTSTAMP:(TEXT)indicates the date/time that the instance of the iCalendar object was created. SUMMARY:(TEXT)short summary or subject for the calendar component DTSTART;VALUE=DATE:(DATE-TIME by default, but can specifie another value type like here DATE) specifies when the calendar component begins CLASS:(TEXT) the access classification for a calendar component TRIGGER:(DURATION by default, but can specifie another value type) specifies when an alarm will trigger
LAST-MODIFIED:(DATE-TIME) analogous to the modification date and time for a file in the file system GEO:(two SEMICOLON separated FLOAT values) information related to the global position for the activity PRIORITY:(INTEGER) relative priority for a calendar component STATUS:(TEXT) can indicate that an action item needs action, is completed, is in process or being worked on, or has been cancelled CATEGORIES:(TEXT) categories for a calendar component, more than one category can be specified separated by COMMA
RELATED-TO;RELTYPE=PARENT:(TEXT) represent a relationship or reference between one calendar component and another SOME THINGS:
|
And about the libraries, 2 of them were listed above in this thread, there is a third one, vobject.
Something like https://github.com/sabre-io/vobject but not in PHP would have been nice. |
Okay, I had some time to work on it. For now, I am trying to figure out limitations and possible issues with different format.
|
It's been a while, but I started implementing it. So far, n 170671c I implemented read-only tasks and events from .ics files. You need to add path to your ics files (which is synced by vdirsyncer) to your config:
I tested with nextcloud, it works pretty well. It should be available to everyone in version 2.7. Then, we'll test read-only mode a bit and think how to better implement editing mode and maybe switch completely to .ics file and migrate everybody. UPDATE:
|
Okay, I just published version 2.7 where viewing .ics files is working. At least my tests with Nextcloud and vdirsyncer work. Please upgrade For instructions, see this wiki page and vdirsyncer manuals. Have fun :) p.s. it turns out that different calendar services implement .ics filse quite differently, so some issues are to be expected. If you experience one, please share. |
First of all, great app! Would it be possible to add wildcards to the |
Thank you! However, I think the solution is simple, just add another record to your vdirsyncer config to also sync it as a single file (here is an example). So you'd have a single file for calcure and a folder for khal (can't khal read single files?). I know it's not optimal, but for now it's like that. |
The solution was indeed pretty simple. It implies duplicates in terms of syncing and ics files, but that is not a big worry. One question though: is calcure able to read timezones in ics files or did I do something wrong? Because I cannot seem to get the proper timezone for some events. By investigating this a little bit further, it seems that Calcure gets the DTEND and the DTSTART but not the X-WR-TIMEZONE. Am I right? |
One nice-to-have would be specifying the ics location as a url instead of a file path - then fetching it as the program starts. EDIT: I've added a minimal working example in PR #42 |
Thank you for PR, it works great! I'll test a bit more and publish it as a part of 2.8 version. |
You may want to update the docs for using google calendar also, in gcal go to |
That's handy! I was actually thinking what's the easiest way to read from gcal, and it seems to be the one. I managed to escape % with |
Just pushed a new version to PyPi, in which, thank to @nfultz , displaying from URLs (for example Google calendar) also works. Here is the instruction how to set it up. Please upgrade and test. In the next version, I'll rewrite it all a bit to get different colors for different calendars #40 |
Hi! I maintain vdirsyncer and todoman. I like this TUI and would love to see some synergy. Mainly, the way information is laid out at-a-glance (as seen in the main screenshot of this repo) is something that I'm really missing. I read through this long thread, and here are the main thoughts I have in mind:
You probably want to use a library which handles this for you. In todoman I use the If you have specific questions or doubts, I'm happy to help. It's always nice to see more implementations using icalendar/vdir in general. |
Hi @WhyNotHugo , thank you for checking out this project!
|
This magic happens in
Yeah, it's become pretty complicated over the years, mostly to optimize parsing. Basically we have an sqlite database (the "cache"). It keeps the At startup, todoman reads the sqlite database, and traverses directories. If any new files are found, they're read and added to the database. If a file is an event (e.g.: don't care about it for todoman), it goes into another table in the DB, so we know not to bother reading it next time. If any files' last modified date has change, we re-read it and fill the sqlite db again. At this point, the cache is fully up to date (and this is a lot cheaper than parsing all files). Ironically, modifying an entry does re-read the original ics file as mentioned above: to keep all unknown fields intact. The sqlite database is safe to delete at any time: it really is just a cache. The next run is just slower because it has to regenerate it. |
After all the discussions, I implemented bd8e9ae reading from ics folders as well. Now, you can use single ics file, a url, or a folder or url files, the program should understand what you mean and parse accordingly. Please |
Things look good overall except that Fastmail's editor creates |
@mathstuf does it crash the program? I think I can try to skip lines like that, as we already do with PRODID. EDIT: I implemented a quick fix for that, in version 2.8.2 it should at least not crash on this line and also parse other files even if one file has something wrong in it. |
I've pointed the config to an existing collection:
But |
@WhyNotHugo could you please check info.log file in your config folder? Does it mention anything relevant? |
|
Ah, wait, the |
Oh, I didn't notice it said The auto-generated config file has this entry, but not Works okay now. |
Hello, I guess I have a problematic one :D Any way we can figure out a workaround? EDIT: |
I edited the venv to log the exception and then searched where that came from for my issue. |
Ok, I just removed the
So it's still the problem with multiple PRODIDs. I'm on 2.8.2, I guess the fix you mention above is not working for this file @anufrievroman ? |
Hi @eguiraud , thank you for reporting and investigating! NOTE TO MYSELF: I need to make errors more explicit, at least showing the error type... |
This is the beginning of
Interestingly, if I export the calendar to a .ics directly from Nextcloud it looks very different, with only 2 PRODID lines (but anyway again more than 1 and non-consecutive). |
I see, I actually had exactly the same problem. This is something @WhyNotHugo might be interested as well. |
Thank you for the quick reaction! Unfortunately I can't use vdirsyncer+calcure because of pimutils/vdirsyncer#818 at the moment -- I can give this a go if/when that gets fixed :) |
Thanks for your work on this. Most of it works very well, but I ran into an issue with an ICS folder synced via
|
Hi @thezeroalpha , thank you for reporting! At the moment, I am on vacation, so if someone could add a line, something like:
That would be very helpful! |
See discussion here: anufrievroman#4 (comment)
Thank you again for the PR! The change was pushed into the repo, it's in the version 2.9. |
Hi guys, we are testing improved support for ics files with icalendar library, thanks to contribution by @jose1711
This version is supposed to parse ics files much faster than before. |
By a first look, it seems to work well and it is way much faster than before. |
Thanks again for the app! I really like it. I want to point out an issue I am having with one of my calendars. This calendar originates in Outlook, then I import it in Google. As with my other calendars, I sync it with vdirsyncer and its calendar events appear regularly on khal. When I try to import it in calcure, the calendar does not show up. The same if I just use the link provided by Outlook for ics files. Is there some kind of basic incompatibility between the ics libraries/calcure and Outlook ics files? |
@euglevi is there anything mentioned in the info.log file? It's in the config folder. There's no inherent incompatibility, but sometimes there are lines in ics files that break things. Which version you are using? |
I am using the git version with the new ics library, but this problem was already there with the previous library. The info.log file is empty. Just to give you an example of the ics file calcure did not read which was related to a today's event:
|
See this line: Line 149 in 87ca8c5
It is a limit for a number of characters of event name.
If you lift that limit you should be able to see it in |
That's probably right! No idea why and when I put it there :D |
@euglevi I fixed it in the main branch, could you try this version on your files?
|
I confirm that now it works perfectly! |
There was still a little issue apparently, but now it seems to be fixed. I think there still might be a problem that event with time but without timezone might have issues, although I was not able to produce such event. |
Okay, in the new version 3.0 the support of Please upgrade and test:
|
Feature
Support ICS files.
https://en.wikipedia.org/wiki/ICalendar
Sample ICS file:
See this repository for more calendars: https://github.com/xmha97/Calendars
The text was updated successfully, but these errors were encountered: