Taskwarrior ⬄ Caldav Server
Synchronize taskwarrior tasks to a generic caldav server. This service has been tested using a self-hosted nextcloud server as well as , but should theoretically work with any server that implements the caldav specification
Upon execution, tw_caldav_sync
will synchronize, and on subsequent runs of the
program keep synchronized, the following attributes (tw entries will be converted to a vCard format and visa versa):
TW <-> Caldav will make the following mappings between items:
description
<->SUMMARY
status
<->STATUS
pending
,waiting
<->NEEDS-ACTION
completed
<->COMPLETED
deleted
<->CANCELLED
- TW
modified
<->LAST-MODIFIED
- TW
prioriy
<->PRIORITY
""
<->None
L
<-> 9M
<-> 5H
<-> 1
- TW
annotations
,uuid
<->DESCRIPTION
- TW
tags
<->CATEGORIES
- No specific support for "waiting" tasks in taskwarrior, they will be treated like any other "needs-action" caldav task
- No support for recurring tasks sync in either direction
Install the syncall
package from PyPI, enabling the caldav
and taskwarrior
extra:
pip3 install syncall[caldav, taskwarrior]
You can synchronize a series of Taskwarrior tasks that have a particular (or multiple) tags or synchronize all the tasks that belong to a particular project.
Use --taskwarrior-tags ...
or --taskwarrior-project
respectively for the
above
In order to successfully run a sync, you will need the following flags set (mandatory):
--caldav-url
: URL where the caldav calendar is hosted at (including/dav
if applicable)--caldav-user
: Username required to authenticate your caldav instance- Can also be provided via the
CALDAV_USER
environment variable
- Can also be provided via the
--caldav-passwd
,--caldav-passwd-pass-path
: Path to your password.gpg
file in your password store- Alternatively, the password can be provided directly via the
CALDAV_PASSWD
environment variable
- Alternatively, the password can be provided directly via the
The following flag is optional:
--calendar
: Name of the caldav Calendar to sync (will be created if not there), will default toPersonal
if not set
With flags:
tw_caldav_sync --caldav-url https://nextcloud.example.com/remote.php/dav --caldav-calendar MyCalendar --caldav-user myUser --caldav-passwd path/to/myPass --taskwarrior-tags sync
With environment variables:
CALDAV_USER=myUser CALDAV_PASSWD=myPass tw_caldav_sync --caldav-url https://nextcloud.example.com/remote.php/dav --caldav-calendar MyCalendar --taskwarrior-tags sync
- See if we can handle TW "waiting" tasks a little better (possibly by setting the caldav
start
field to when the wait expires) - Consider how to refactor out extra steps in conversion, and just store caldav items in their vTodo formats (though this will make test files much uglier)