Skip to content

Files

Latest commit

 

History

History
136 lines (97 loc) · 3.68 KB

README.md

File metadata and controls

136 lines (97 loc) · 3.68 KB

csv2ical

Python versions MIT license uv Ruff CI badge DOI

A CLI tool that converts a CSV file with event details into an iCalendar ICS file. The ICS file can then be imported into apps like Google Calendar, Microsoft Outlook, Apple macOS Calendar and etc.

Installation

First, install uv.

Then:

uv tool install git+https://github.com/rlan/csv2ical

Verify installation:

uv tool list
csv2ical v1.0.1
- csv2ical

Usage

csv2ical --help
Usage: csv2ical [OPTIONS] CSV_NAME ICS_NAME

  Convert a CSV file to an ICS file.

  Convert a CSV file with event details to an iCalendar ICS file, which can be
  imported into apps like Google Calendar, Microsoft Outlook, Apple macOS
  Calendar and etc.

  CSV_NAME is the file name of a CSV file with event details.

  ICS_NAME is the resulting iCalendar ICS file.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Example:

sample.csv:

"Subject","Start Date","Start Time","End Date","End Time","Description","Location"
"Harry Potter birthday","1980-07-31","00:00","1980-08-01","00:00","The Chosen One","Godric's Hollow"
"Ron Weasley birthday","1980-03-01","00:00","1980-03-02","00:00","Won-Won","Ottery St Catchpole"
"Hermione Granger birthday","1979-09-19","00:00","1979-09-20","00:00","'Mione",""

An all-day event starts at midnight and ends at the midnight of the next day. Although sample.csv contains only all-day events, e.g. birthdays, any shorter events, e.g. meetings, would also work.

The names in the CSV header row is documentation. It tells the author of the CSV file which column to write the event details. Editing that row has no effect on the output ICS file, but do not omit it.

Reproduce sample.ics:

csv2ical sample.csv sample.ics
cat sample.ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//sample.csv//mxm.dk//
BEGIN:VEVENT
SUMMARY:Harry Potter birthday
DTSTART;VALUE=DATE-TIME:19800731T000000
DTEND;VALUE=DATE-TIME:19800801T000000
DESCRIPTION:The Chosen One
LOCATION:Godric's Hollow
END:VEVENT
BEGIN:VEVENT
SUMMARY:Ron Weasley birthday
DTSTART;VALUE=DATE-TIME:19800301T000000
DTEND;VALUE=DATE-TIME:19800302T000000
DESCRIPTION:Won-Won
LOCATION:Ottery St Catchpole
END:VEVENT
BEGIN:VEVENT
SUMMARY:Hermione Granger birthday
DTSTART;VALUE=DATE-TIME:19790919T000000
DTEND;VALUE=DATE-TIME:19790920T000000
DESCRIPTION:'Mione
LOCATION:
END:VEVENT
END:VCALENDAR

Update to a new version

uv tool upgrade csv2ical

Uninstallation

uv tool uninstall csv2ical

Development

See development.md

Citation

If this project helps your research, don't hesitate to spread the word! Click on the badge below and find citation formats (e.g., BibTeX and etc) at the bottom of that page.

DOI

License

MIT