Compare commits

...

5 commits

8 changed files with 142 additions and 18 deletions

View file

@ -1,35 +1,95 @@
# Kiwimix (calendar mixer)
Swiss knife for calendars
Swiss knife for ical & caldav calendars
## Roadmap
Access to calendar (with credentials)
Read a calendar
* :x: with hardcoded data :wink:
* :x: with data from config file with multiple calendars
Access to calendar
* :x: access to public calendar
* :x: access to private calendar (with credentials)
* :x: with data from config file with multiple calendars
Download calendar events locally
* :x: choose source calendar
* :x: as separate files ?
* :x: as an in-memory database ?
Upload calendar events remotely
* :x: choose target calendar
* :x: choose source calendar
* :x: as separate files ?
* :x: as an in-memory database ?
Merge events
* :x: merge overlapping events
* :x: keep (internal) reference to source-calendars/parent-events
* :x: anonymize events
* :x: merge overlapping events
* :x: keep reference to source-calendars/parent-events (meta-data? external?)
* :x: make selected event (source calendar? pattern?) private or anonymous
Upload calendar events remotely
* :x: associate mixed local with remote target calendar
* :x: handle event ids & duplicates
Web I
* :x: split into library + CLI util
* :x: write an API for the lib
* :x: add a web frontend
* :x: add user management & multi-account
* :x: split into library + CLI util
* :x: write an API for the lib
* :x: add a web frontend
* :x: add user management & multi-account
Serve calendar locally
* :x: provide caldav urls for generated calendars
##
Find free time
kiwimix generate \
--from-date XXX --to-date YYY \
--from-time 9:00 --to-time 19:00 \
| kiwimix substract - agenda.ics \
Find free time for a meeting
kiwimix generate \
--from-date XXX --to-date YYY \
--from-time 9:00 --to-time 19:00 \
> full.ics
kiwimix union alice.ics bob.ics \
> events.ics
kiwimix substract full.ics events.ics \
> free.ics
Rewrite events
kiwimix filter --merge alice.ics \
| kiwimix filter --anonymize - \
V2 (with stack support)
kiwimix
generate --.... # generate X calendar & push
@ read alice # push alice.ics
@ filter --merge # pop alice, filter & push
@ filter --anonymize # pop alice, filter & push
@ read bob # push bob.ics
@ filter --merge # pop bob, filter & push
@ filter --anonymize # pop bob, filter & push
@ union # pop bob, pop alice, compute alice - bob
@ substract # pop bob, pop alice, compute alice - bob
kiwimix filter --anonymize --merge alice.ics
kiwimix load bob.ics ! anonymize ! merge
## References
* https://github.com/PuloV/ics-golang => features missing but the code is OK
* https://github.com/apognu/gocal => poorly coded
* https://github.com/samedi/caldav-go
* https://github.com/emersion/go-webdav

View file

@ -0,0 +1,39 @@
package main
import (
"fmt"
"io/ioutil"
ics "github.com/PuloV/ics-golang"
_ "github.com/mattn/go-sqlite3/driver"
)
func assertOk(e error) {
if e != nil {
panic(e)
}
}
func main() {
fmt.Println("Hello world")
icsBytes, err := ioutil.ReadFile("example.ics")
assertOk(err)
// start, end := time.Now(), time.Now().Add(12*30*24*time.Hour)
parser := ics.New()
parser.Load(string(icsBytes))
_, err = parser.GetErrors()
assertOk(err)
calendars, err := parser.GetCalendars()
assertOk(err)
events := calendars[0].GetEvents()
for _, e := range events {
fmt.Printf("%#v\n", e)
// fmt.Printf("%s on %s by %s\n", e.Summary, e.Start, e.Organizer.Cn)
}
// fmt.Print(string(f))
}

9
go.mod Normal file
View file

@ -0,0 +1,9 @@
module github.com/glenux/kiwimix
go 1.16
require (
github.com/PuloV/ics-golang v0.0.0-20190808201353-a3394d3bcade
github.com/apognu/gocal v0.8.0 // indirect
github.com/channelmeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61 // indirect; explicit
)

15
go.sum Normal file
View file

@ -0,0 +1,15 @@
github.com/ChannelMeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61 h1:N5Vqww5QISEHsWHOWDEx4PzdIay3Cg0Jp7zItq2ZAro=
github.com/ChannelMeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61/go.mod h1:GnKXcK+7DYNy/8w2Ex//Uql4IgfaU82Cd5rWKb7ah00=
github.com/PuloV/ics-golang v0.0.0-20190808201353-a3394d3bcade h1:odEkSCl2gLWPtvraEdCyBZbeYyMMTysWPLMurnB8sUY=
github.com/PuloV/ics-golang v0.0.0-20190808201353-a3394d3bcade/go.mod h1:f1P3hjG+t54/IrnXMnnw+gRmFCDR/ryj9xSQ7MPMkQw=
github.com/apognu/gocal v0.8.0 h1:uwbD4pdaxOw9hIjBNzFLTbdSraxB518Tmb8wGfNJrwE=
github.com/apognu/gocal v0.8.0/go.mod h1:1UqOwBmHJ/oYF7NgorHPNx48sGfzrd748N+RJ7T+qok=
github.com/channelmeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61 h1:o64h9XF42kVEUuhuer2ehqrlX8rZmvQSU0+Vpj1rF6Q=
github.com/channelmeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61/go.mod h1:Rp8e0DCtEKwXFOC6JPJQVTz8tuGoGvw6Xfexggh/ed0=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/stretchr/testify v1.2.0 h1:LThGCOvhuJic9Gyd1VBCkhyUXmO8vKaBFvBsJ2k03rg=
github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=

0
pkg/kiwimix/substract.go Normal file
View file

0
pkg/kiwimix/union.go Normal file
View file

1
pkg/kiwimix/version.go Normal file
View file

@ -0,0 +1 @@
package kiwimix