GithubHelp home page GithubHelp logo

ajrosen / icalpal Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 3.7 MB

Command-line tool to query the macOS Calendar and Reminders

License: GNU General Public License v3.0

Ruby 99.06% Makefile 0.94%
calendar macos reminders

icalpal's Issues

Problem with CSV export for recurring events

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:

  • the 'daynum' column contains the designated end date for the series
  • the 'stime' column contains the sday value
  • the stime value is displaced into the 'etime' column
  • the etime value lands in the 'sday' column

See screenshot of sample csv data, attached
Screenshot 2024-03-30 at 13 14 48

--ab option not working

Hi, thanks for making icalPal!

I've encountered issues while using the --ab option :

1. Error with Empty Argument in --ab

  • Command: icalPal --ab="" eventsToday
  • Expected Behavior: The command should remove the bullets.
  • Actual Behavior: The command results in an error message invalid argument: --ab=.

2. Bullets Not Replacing with --ab="-"

  • Command: icalPal --ab="-" eventsToday
  • Expected Behavior: The bullets should get replaced with -
  • Actual Behavior: The bullets do not get replaced.

Sudo Required for install and use

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>'

Error when generating CSV output

$ 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>'

icalPal in Cron

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?

icalPal Hangs

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>'

Add XML output option

#10 (comment)

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.

Fields missing from XML output

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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.