Skip to content
/ calibex Public
forked from kbrw/calibex

Elixir ICal : bijective coding/decoding for ICal transformation, ICal email request and responses.

License

Notifications You must be signed in to change notification settings

svycal/calibex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calibex

Please read the doc at : https://hexdocs.pm/calibex

Handle exhaustively ICal format: bijective coding/decoding for ICal transformation, ICal email request and responses.

Simple algorithm for ICal encoding : every ICal fields handled.

ICal Elixir bijective format

The ICal elixir term is exactly a representation of the ICal file format : for instance :

[vcalendar: [[
  prodid: "-//Google Inc//Google Calendar 70.9054//EN",
  version: "2.0",
  calscale: "GREGORIAN", 
  vevent: [[
    dtstart: %DateTime{},
    dtend: %DateTime{},
    organizer: [cn: "My Name",value: "mailto:me@example.com"],
    attendee: [cutype: "INDIVIDUAL",role: "REQ-PARTICIPANT",partstat: "NEEDS-ACTION",rsvp: true, cn: "Moi",
                "x-num-guests": 0, value: "mailto:me@example.com"],
  ]]]]]

Calibex.encode/1 and Calibex.decode/1 parse and format an ICal from this terms : see functions doc to find encoding rules.

Using this terms make it possible to handle all types of ICal files and any fields type. But the downside of this approach is that it can be cumbersome to create and handle this tree of keyword lists. To help you in this tasks, some helpers functions are provided :

  • Calibex.new/1
  • Calibex.new_root/1
  • Calibex.request/1

Example usage : email event request generation

Calibex.request(dtstart: Timex.now, dtend: Timex.shift(Timex.now,hours: 1), summary: "Mon évènement",
          organizer: "arnaud.wetzel@example.com", attendee: "jeanpierre@yahoo.fr", attendee: "jean@ya.fr")
 |> Calibex.encode

About

Elixir ICal : bijective coding/decoding for ICal transformation, ICal email request and responses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%