ajrosen / icalpal Goto Github PK
View Code? Open in Web Editor NEWCommand-line tool to query the macOS Calendar and Reminders
License: GNU General Public License v3.0
Command-line tool to query the macOS Calendar and Reminders
License: GNU General Public License v3.0
Tracking issue for:
Some fields, such as "notes", are likely to contain line breaks. Field values with line breaks need to be wrapped as in order to be properly parseable.
Hi Andy -- CSV export is working now, thank you! but there's still a small problem with the exports -- please see below.
Recurring events export with misaligned data:
Hi, thanks for making icalPal!
I've encountered issues while using the --ab option :
--ab
icalPal --ab="" eventsToday
invalid argument: --ab=
.--ab="-"
icalPal --ab="-" eventsToday
Hello again, I have found that in order to update or execute iCalPal I now require sudo rights. This wasn't the case originally. I assume it is due to some recent changes?
When executing iCalpal without Sudo I get the following:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require': cannot load such file -- core_ext/string (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
from /Library/Ruby/Gems/2.6.0/gems/nokogiri-plist-0.5.0/lib/nokogiri-plist.rb:17:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-2.0.0/lib/reminder.rb:2:in `<top (required)>'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-2.0.0/lib/icalPal.rb:6:in `require_relative'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-2.0.0/lib/icalPal.rb:6:in `<top (required)>'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-2.0.0/bin/icalPal:12:in `require_relative'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-2.0.0/bin/icalPal:12:in `<top (required)>'
from /usr/local/bin/icalPal:23:in `load'
from /usr/local/bin/icalPal:23:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- core_ext/string (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Library/Ruby/Gems/2.6.0/gems/nokogiri-plist-0.5.0/lib/nokogiri-plist.rb:17:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-2.0.0/lib/reminder.rb:2:in `<top (required)>'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-2.0.0/lib/icalPal.rb:6:in `require_relative'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-2.0.0/lib/icalPal.rb:6:in `<top (required)>'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-2.0.0/bin/icalPal:12:in `require_relative'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-2.0.0/bin/icalPal:12:in `<top (required)>'
from /usr/local/bin/icalPal:23:in `load'
from /usr/local/bin/icalPal:23:in `<main>'
$ icalPal -o csv
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/csv.rb:1402:in `initialize': no implicit conversion of Hash into String (TypeError)
str = StringIO.new(str)
^^^
from /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/csv.rb:1402:in `new'
from /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/csv.rb:1402:in `generate'
from ./bin/icalPal:156:in `<main>'
Hi, firstly thanks for developing this spiritual successor to iCalBuddy, really makes my upcoming project a lot easier because of the JSON output.
However, I am having trouble running icalPal with Cron on MacOS.
Previously I got around this issue by bundling my script in a .app, but was wondering if there might be a way to make it work natively with iCalPal?
Hello, I've been using iCalPal for some time now without any issue, however recently the command stopped working and instead hangs. It seems to do nothing, requiring me to stop it with ctrl+c. No idea what could be wrong.
icalPal eventsToday -d debug
[DEBUG] 14:57:56.889 [options.rb:238:in `parse_options'] - Opening database: /Users/User/Library/Calendars/Calendar.sqlitedb
[INFO ] 14:57:56.891 [icalPal:36:in `<top (required)>'] - Options: {:aep=>[], :bullet=>"•", :cf=>"/Users/User/.icalPal", :cmd=>"events", :color=>false, :days=>1, :db=>"/Users/UserLibrary/Calendars/Calendar.sqlitedb", :debug=>"debug", :df=>"%b %-d, %Y", :ea=>false, :ec=>[], :eed=>false, :eep=>[], :es=>[], :et=>[], :from=>today, :ic=>[], :iep=>["title", "location", "notes", "url", "attendees", "datetime"], :is=>[], :it=>[], :li=>0, :n=>false, :nnr=>"\n ", :nrd=>false, :output=>"default", :props=>["title", "location", "notes", "url", "attendees", "datetime"], :ps=>["\n "], :r=>false, :sa=>false, :sc=>false, :sd=>false, :sed=>false, :sep=>false, :sort=>"sdate", :sp=>false, :ss=>"\n------------------------", :tf=>"%-I:%M %p", :to=>tomorrow, :uid=>false}
[DEBUG] 14:57:56.891 [icalPal:59:in `<top (required)>'] - SELECT DISTINCT Store.name AS account, Store.type, Calendar.color, Calendar.title AS calendar, Calendar.subcal_url, Calendar.symbolic_color_name, CAST(CalendarItem.end_date AS INT) AS end_date, CAST(CalendarItem.orig_date AS INT) AS orig_date, CAST(CalendarItem.start_date AS INT) AS start_date, CAST(CalendarItem.end_date - CalendarItem.start_date AS INT) AS duration, CalendarItem.all_day, CalendarItem.availability, CalendarItem.conference_url_detected, CalendarItem.description AS notes, CalendarItem.has_recurrences, CalendarItem.invitation_status, CalendarItem.orig_item_id, CalendarItem.rowid, CalendarItem.start_tz, CalendarItem.status, CalendarItem.summary AS title, CalendarItem.unique_identifier, CalendarItem.url, CalendarItem.uuid, json_group_array(DISTINCT CAST(ExceptionDate.date AS INT)) AS xdate, json_group_array(DISTINCT Identity.display_name) AS attendees, Location.address AS address, Location.title AS location, Recurrence.count, CAST(Recurrence.end_date AS INT) AS rend_date, Recurrence.frequency, Recurrence.interval, Recurrence.specifier, min(Alarm.trigger_interval) AS trigger_interval FROM Store JOIN Calendar ON Calendar.store_id = Store.rowid JOIN CalendarItem ON CalendarItem.calendar_id = Calendar.rowid LEFT OUTER JOIN Location ON Location.rowid = CalendarItem.location_id LEFT OUTER JOIN Recurrence ON Recurrence.owner_id = CalendarItem.rowid LEFT OUTER JOIN ExceptionDate ON ExceptionDate.owner_id = CalendarItem.rowid LEFT OUTER JOIN Alarm ON Alarm.calendaritem_owner_id = CalendarItem.rowid LEFT OUTER JOIN Participant ON Participant.owner_id = CalendarItem.rowid LEFT OUTER JOIN Identity ON Identity.rowid = Participant.identity_id WHERE Store.disabled IS NOT 1 GROUP BY CalendarItem.rowid ORDER BY CalendarItem.unique_identifier
[INFO ] 14:57:56.962 [icalPal:70:in `<top (required)>'] - Loaded 3175 rows from /Users/User/Library/Calendars/Calendar.sqlitedb
^C/Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/lib/event.rb:159:in `load': Interrupt
from /Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/lib/event.rb:159:in `clone'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/lib/event.rb:203:in `block (2 levels) in get_occurrences'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/lib/event.rb:199:in `detect'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/lib/event.rb:199:in `block in get_occurrences'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/lib/event.rb:193:in `each'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/lib/event.rb:193:in `get_occurrences'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/lib/event.rb:140:in `recurring'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/bin/icalPal:103:in `block in <top (required)>'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/bin/icalPal:78:in `each'
from /Library/Ruby/Gems/2.6.0/gems/icalPal-1.1.6/bin/icalPal:78:in `<top (required)>'
from /usr/local/bin/icalPal:23:in `load'
from /usr/local/bin/icalPal:23:in `<main>'
I wonder how tricky it would be to add an xml output option? I'm trying to streamline a workflow using a particular WP import plugin that only accepts csv and xml files.
I've run quite a few tests with different calendars and options, and while I was originally distracted by the line breaks problem (see Issue #19), now I'm realizing that only a handful of fields are being exported. Essential fields such as date and time are not included.
Here's a sample event from an export file:
<event>
<account>XXX@gmail</account>
<type>CalDAV</type>
<color>#92E1C0FF</color>
<calendar>Holidays in United States</calendar>
<symbolic_color_name>#92E1C0FF</symbolic_color_name>
<notes>Observance
To hide observances, go to Google Calendar Settings > Holidays in United States</notes>
<start_tz>_float</start_tz>
<title>Easter Monday</title>
<unique_identifier>[email protected]</unique_identifier>
<UUID>DEBF48A9-26DE-4D7B-97A6-40A73518372F</UUID>
<xdate/>
<attendees/>
</event>
(By the way it would be helpful if newlines were added by default as in the above example to make the files more readable. The same event from the raw export appeared like this:
<event><account>XXX@gmail</account><type>CalDAV</type><color>#92E1C0FF</color><calendar>Holidays in United States</calendar><symbolic_color_name>#92E1C0FF</symbolic_color_name><notes>Observance
To hide observances, go to Google Calendar Settings > Holidays in United States</notes><start_tz>_float</start_tz><title>Easter Monday</title><unique_identifier>[email protected]</unique_identifier><UUID>DEBF48A9-26DE-4D7B-97A6-40A73518372F</UUID><xdate/><attendees/></event>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.