Native support for Apple Calendar has been added to Alexa so this repo is no longer needed.
alexa-apple-calendar
An example Alexa Skill to read upcoming events from Apple Calendar, written in Python.
Dependencies
- An AWS account
- A pre-existing Apple ID with events in the calendar.
Quick Start
- Open
lambda_function.py
, fill in your Apple ID username and password at the top and save. If you use 2 factor authentication then you will need to turn it off, as the Apple web service doesn't seem to work with app specific passwords.
- Zip up the four folders (dateutil, pytz, requests & tzlocal) and the three .py files (apple_calendar_api.py, isoweek.py and lambda_function.py) into a single zip file.
- Create an AWS Lambda function
using your zip file as the code
- You can follow the official Amazon
instructions
to give you a hand
- You should uncomment the block in the
lambda_handler
function and
insert your applicationId
to only allow requests coming from your
applicationId
- You can use
test_event.json
as your test template.
- Consider extending the timeout beyond the default of 3 seconds (I raised mine to 10, which is likely excessive, but may eliminate some sporadic errors)
- Create a new Alexa
Skill using
intent_schema.json
and sample_utterances.txt
. You can choose your own word for invocation (I use calendar
).
- Don't publish the skill (because it includes your Apple ID username and password), leave it in development mode
- Test that it's working from the web interface during the creation of the
skill
- Test that it's working with your Echo
Examples
So far the following commands work:
Alexa ask calendar today
- lists events happening today
Alexa ask calendar tomorrow
- lists events happening tomorrow
Alexa ask calendar Monday
(or any other day) - lists events happening on the next day given
Alexa ask calendar this week
- lists events between today and next Sunday
Alexa ask calendar next week
- lists a full week of events starting from next Monday
Note that if you used something other than calendar
for the invocation word, you must substitute that in the above examples.
Known Issues
- Currently you can't add new events as the Apple web service doesn't allow this.
- Doesn't work if you use 2 Factor Authentication to protect your Apple account.
- As a consequence of the point above, I receive an email from Apple every single time it runs telling me I have logged into a new computer so I've set my email host to delete all these.
Acknowledgements