The ICloud API for events management
Project description
About
The ICloud API for events management
Tools
- Python 3
How to install with pip
Run this command:
pip install apple-calendar-integration
How to create event
from datetime import datetime, timedelta
from apple_calendar_integration import ICloudCalendarAPI
api = ICloudCalendarAPI(username, password)
start_date = int(datetime.now().timestamp())
end_date = start_date + timedelta(hours=2)
etag, ctag, guid = api.create_event('Your title', start_date, end_date)
This python script will create one two hour event from now. etag
, ctag
and guid
will be used to edit or delete event.
How to delete event
from apple_calendar_integration import ICloudCalendarAPI
api = ICloudCalendarAPI(username, password)
api.delete_event(new_etag, ctag, guid)
Should return True
if everything is OK.
How to edit event with repeat
How to add repeat num of times with some frequency
{
"count": 5,
"freq": "daily"
}
This will mean repeat every day for 5 times(days).
freq
has such options:
- daily
- weekly
- monthly
- yearly
How to add repeat until date with some frequency
Also, you can specify not num of times, but with the end date parameter.
{
"until": 1536910206,
"freq": "monthly"
}
All code together
from apple_calendar_integration import ICloudCalendarAPI
api = ICloudCalendarAPI(username, password)
repeat = {
"until": 1536910206,
"freq": "monthly"
}
new_etag = api.edit_event(etag, ctag, guid, repeat=repeat)
Should return new etag
if everything is OK
How to edit event with alarm
If you want to create alarm in the moment of event
{
"before": false
}
If before the event
{
"before": false,
"hours": 3,
"minutes": 2,
"seconds": 1
}
This will send notification about event 3 hours 2 minute and 1 second before event start date
There are such options:
- weeks
- days
- hours
- minutes
- seconds
All code together
from apple_calendar_integration import ICloudCalendarAPI
api = ICloudCalendarAPI(username, password)
alarm = {
"before": False,
"hours": 3,
"minutes": 2,
"seconds": 1
}
new_etag = api.edit_event(etag, ctag, guid, alarm=alarm)
Should return new etag
if everything is OK
How to edit event with invites
How to add new people to event
from apple_calendar_integration import ICloudCalendarAPI
api = ICloudCalendarAPI(username, password)
invites = ["email_1@gmail.com", "email_2@gmail.com"]
new_etag = api.edit_event(etag, ctag, guid, add_invites=invites)
How to remove someone from invites
from apple_calendar_integration import ICloudCalendarAPI
api = ICloudCalendarAPI(username, password)
invites = ["email_1@gmail.com"]
new_etag = api.edit_event(new_etag, ctag, guid, remove_invites=invites)
Should return new etag
if everything is OK
How to edit note
, url
, title
or event date
from apple_calendar_integration import ICloudCalendarAPI
import time
api = ICloudCalendarAPI(username, password)
new_etag = api.edit_event(etag, ctag, guid,
note='New notw', url='https://my_url.com', title='New title',
start_date_timestamp=int(time.time()), end_date_timestamp=int(time.time()) + 1000)
Should return new etag
if everything is OK
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file apple-calendar-integration-0.0.1.tar.gz
.
File metadata
- Download URL: apple-calendar-integration-0.0.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95680e5c19a85e360f7322919211e6013665d660f30b12b8b95998541546bccd |
|
MD5 | bbc578328e4e02fc7ed20cefc8ffdee6 |
|
BLAKE2b-256 | 428aef45bcb7260c0d02295ae28ca6e76755cae84ac0ca04737125775e7d6d19 |
File details
Details for the file apple_calendar_integration-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: apple_calendar_integration-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29c0047d41428b2b55566c62a2669f7df6cb6f340379388afa9364fe89384d4a |
|
MD5 | 708529fa2a40075ee36da7ab3beb28e2 |
|
BLAKE2b-256 | 80e653062bc84b733f8de84a9f6e74e47dc0e5170d3eb0e4014fb86b2d79f896 |