vCard and iCalendar support for ruby
Ruby Other
Latest commit 5002482 Feb 2, 2015 @dpocock dpocock Merge pull request #18 from dpocock/dpocock-travis
travis-ci: initial config
Failed to load latest commit information.
lib Vtodo, Vevent: Fix typos in comments Feb 2, 2015
samples Removed CVS cruft. Mar 15, 2009
test Improve Vtodo support / add Maker Jan 31, 2015
.gitignore v13.11.11 release Nov 11, 2013
.travis.yml travis-ci: initial config Feb 2, 2015
CHANGES Prep for release Mar 2, 2009
README.rdoc Update README to recommend gem install Oct 5, 2013
THANKS - Fixed some problems with rescue statements not being specific enough. Mar 30, 2008
ex_fmt_convert.rb example of faking out an IO to do fmt conversion Apr 4, 2006
ex_ics_api.rb example of a location field Mar 2, 2008
gemspec.rb Create vpim_icalendar.gemspec for building the vpim_icalendar gem Oct 4, 2013
mbox2vcard.rb FREQ=weekly support Feb 25, 2008 . Jun 7, 2006
profile.rb these used the samples/, now data/ Mar 23, 2006
profile.txt put date in changelog, new make targets, new profile results Mar 9, 2006
vpim.gemspec v13.11.11 release Nov 11, 2013
vpim_icalendar.gemspec Create vpim_icalendar.gemspec for building the vpim_icalendar gem Oct 4, 2013



Sam Roberts <>


Copyright (C) 2008 Sam Roberts


May be distributed under the same terms as Ruby



gem install vpim

vPim provides calendaring, scheduling, and contact support for Ruby through the standard iCalendar and vCard data formats for “personal information” exchange.


  • for sponsoring development of FREQ=weekly and BYSETPOS in recurrence rules.

  • for their generous hosting of this project.


There is a vPim package installable using ruby-gems:

# gem install vpim (may require root privilege)


vCard (RFC 2426) is a format for personal information, see Vpim::Vcard and Vpim::Maker::Vcard.

iCalendar (RFC 2445) is a format for calendar related information, see Vpim::Icalendar.

vCard and iCalendar support is built on top of an implementation of the MIME Content-Type for Directory Information (RFC 2425). The basic RFC 2425 format is implemented by Vpim::DirectoryInfo and Vpim::DirectoryInfo::Field.

The libary is quite useful, but improvements are ongoing. If you find something missing or have suggestions, please contact me. I can't promise instantaneous turnaround, but I might be able to suggest another approach, and features requested by users of vPim go to the top of the todo list. If you need a feature for a commercial project, consider sponsoring development.


Here's an example to give a sense for how iCalendars are encoded and decoded:

require 'vpim/icalendar'

cal = Vpim::Icalendar.create2

cal.add_event do |e|
  e.dtstart, 04, 28)
  e.dtend, 04, 29)
  e.summary       "Monthly meet-the-CEO day"
  e.description <<'---'
Unlike last one, this meeting will change your life because
we are going to discuss your likely demotion if your work isn't
done soon.
  e.categories    [ 'APPOINTMENT' ]
  e.categories do |c| c.push 'EDUCATION' end
  e.url           ''
  e.sequence      0
  e.access_class  "PRIVATE"
  e.transparency  'OPAQUE'

  now =
  e.created       now
  e.lastmod       now

  e.organizer do |o| = "Example Organizer, Mr."
    o.uri = ""

  attendee = Vpim::Icalendar::Address.create("") = true
  e.add_attendee attendee

icsfile = cal.encode

puts '--- Encode:'

puts icsfile

puts '--- Decode:'

cal = Vpim::Icalendar.decode(icsfile).first

cal.components do |e|
  puts e.summary
  puts e.description
  puts e.dtstart.to_s
  puts e.dtend.to_s

This produces:

--- Encode:
PRODID:-//Ensemble Independent//vPim 0.357//EN
SUMMARY:Monthly meet-the-CEO day
DESCRIPTION:Unlike last one, this meeting will change your life because\nwe
  are going to discuss your likely demotion if your work isn't\ndone soon.\n
ORGANIZER;CN="Example Organizer, Mr."
--- Decode:
Monthly meet-the-CEO day
Unlike last one, this meeting will change your life because
we are going to discuss your likely demotion if your work isn't
done soon.
Thu Apr 28 00:00:00 UTC 2005
Fri Apr 29 00:00:00 UTC 2005

More examples of using vPim are provided in samples/.

vCard examples are:

iCalendar examples are:

  • ics-to-rss.txt: prints todos as RSS, or starts a WEBrick servlet that publishes todos as a RSS feed. Thanks to Dave Thomas for this idea, from

  • cmd-itip.txt: prints emailed iCalendar invitations in human-readable form, and see README.mutt for instruction on mutt integration. I get a lot of meeting invitations from Lotus Notes/Domino users at work, and this is pretty useful in figuring out where and when I am supposed to be.

  • reminder.txt: prints upcoming events and todos, by default from Apple's iCal calendars

  • rrule.txt: utility for printing recurrence rules

  • ics-dump.txt: utility for dumping contents of .ics files

Project Information

vPim can be downloaded from the Ruby Forge project page:

or installed as a gem:

  • sudo gem install vpim

For notifications about new releases, or to ask questions about vPim, please subscribe to “vpim-talk”: