Sync iCalendar events to org-mode files while preserving your notes
Project description
ics-to-org
Sync iCalendar events to org-mode files while preserving your notes.
What's New in v1.0.0
This is a major rewrite with significantly improved reliability and simplicity:
- ✅ No more Node.js dependency - Pure Python implementation using the
icalendarlibrary - ✅ Cleaner org format - ICS descriptions stored in
:DESCRIPTION:property, user notes go directly in the event body - ✅ Bulletproof merge logic - Calendar data always updates, user notes always preserved
- ✅ Better timezone handling - Proper handling of UTC and all-day events
- ✅ Comprehensive tests - Real .ics files and .org examples with full integration testing
Installation
Simple single-step installation:
pip install ics-to-org
Or with uv:
uv tool add ics-to-org
Usage
After installation, you can run the tool:
ics-sync --ics-url "https://outlook.office365.com/..." \
--org-file "meetings.org" \
--days-forward 30 \
--days-backward 7
Or run it directly with uvx (no installation needed):
uvx --from ics-to-org ics-sync --ics-url "https://calendar.google.com/calendar/ical/..." \
--org-file "calendar.org"
Command-line options:
| Option | Description | Default |
|---|---|---|
| –ics-url | URL of the iCalendar feed (required) | - |
| –org-file | Path to the org file to update (required) | - |
| –days-forward | Number of days forward to fetch | 30 |
| –days-backward | Number of days backward to fetch | 7 |
| –debug | Enable debug logging | false |
How It Works
The sync process:
- Fetches your calendar from the ICS URL
- Parses your existing org file to extract user notes
- Merges calendar updates with your preserved notes:
- Calendar data (title, time, location, description) always gets updated
- Your personal notes are always preserved
- Removed events are marked as
CANCELLED:but kept with your notes - New events are added cleanly
- Writes the updated org file with events sorted by date
Org File Format
Events are stored in a clean, standard org format:
* Team Meeting
:PROPERTIES:
:UID: meeting123@company.com
:LOCATION: Conference Room A
:DESCRIPTION: Weekly team sync and project updates
:STATUS: CONFIRMED
:CATEGORIES: Work
:END:
<2025-01-15 Wed 14:00-15:00>
My personal notes for the meeting:
- Remember to bring the quarterly report
- Ask about the new project timeline
- Discuss vacation schedule
Action items:
- [ ] Finish the client proposal
- [X] Review the budget numbers
Key features of the format:
:DESCRIPTION:contains the calendar description (read-only):UID:provides the unique identifier for syncing- Event body contains your personal notes in any format (markdown, org-mode, plain text)
- All-day events show as
<2025-01-20 Mon> - Timed events show as
<2025-01-15 Wed 14:00-15:00>
Examples
Basic sync with default settings
ics-sync --ics-url "https://calendar.google.com/calendar/ical/..." \
--org-file "calendar.org"
Longer time range with debug output
ics-sync --ics-url "https://outlook.office365.com/owa/calendar/..." \
--org-file "work-calendar.org" \
--days-forward 60 \
--days-backward 14 \
--debug
Using with uvx (no installation required)
# Run directly from PyPI without installing
uvx --from ics-to-org ics-sync --ics-url "https://example.com/calendar.ics" \
--org-file "my-calendar.org" \
--days-forward 60 \
--debug
Using with uv run (in a project)
uv run ics-sync --ics-url "https://example.com/calendar.ics" \
--org-file "my-calendar.org"
Using with local .ics files
If you can't access the calendar URL directly (common with Outlook), download the .ics file and use it locally:
# Using a local file path
ics-sync --ics-url "/path/to/downloaded/calendar.ics" \
--org-file "calendar.org"
# Or with file:// URL
ics-sync --ics-url "file:///path/to/calendar.ics" \
--org-file "calendar.org"
Troubleshooting
Outlook/Office365 Calendar Issues
If you're having trouble accessing your Outlook calendar:
- Download the .ics file manually: Go to Outlook Web → Calendar → Share → Publish Calendar → Copy the ICS URL → Download it with your browser
- Use the downloaded file:
ics-sync --ics-url "/path/to/calendar.ics" --org-file "events.org" - Check calendar permissions: Make sure your calendar is set to "Public" with "Can view all details" in Outlook settings
- Try the debug flag: Run with
--debugto see detailed error messages
Common Error Messages
- *"Received HTML response instead of ICS data"*: The calendar URL requires authentication or is private
- *"Authentication required"*: Calendar is not publicly accessible
- *"Object moved to here"*: Calendar URL has redirects/authentication issues
For these issues, downloading the .ics file manually is the most reliable solution.
Testing
The project includes comprehensive tests with realistic examples:
pytest tests/ -v
Test coverage includes:
- ✅ Unit tests for all core functions
- ✅ Integration tests with real .ics files and .org files
- ✅ Edge cases like timezone handling, malformed events, empty calendars
- ✅ User note preservation across various markdown and org-mode formats
- ✅ Complete workflows from ICS fetch through merge to org file output
Migration from v0.x
If you're upgrading from the old version:
- Remove the icsorg dependency:
npm uninstall -g icsorg - Update your scripts: Remove
--authorand--emailparameters (no longer needed) - Review your org files: The new format stores descriptions in properties instead of agenda blocks
The new format is cleaner and more reliable, but you may want to manually clean up old agenda blocks if desired.
Development
# Clone the repository
git clone https://github.com/andyreagan/ics-to-org
cd ics-to-org
# Install with uv (recommended)
uv sync
# Run tests
uv run pytest
# Build package
uv build
Contributing
Contributions are welcome! Please:
- Add tests for any new functionality
- Ensure all tests pass:
uv run pytest - Follow the existing code style
- Update documentation as needed
License
MIT License. See LICENSE file for details.
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ics_to_org-1.0.3.tar.gz.
File metadata
- Download URL: ics_to_org-1.0.3.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d38ff6a654b4c8d27121a0e40e7c5163cfc56b78c3467280a2e69285749bf819
|
|
| MD5 |
646e0fad27c1ab08e01f721895899db7
|
|
| BLAKE2b-256 |
8e33f489944b3086960d7f508516ff39c842decc83c5ca28af77fc632223805e
|
File details
Details for the file ics_to_org-1.0.3-py3-none-any.whl.
File metadata
- Download URL: ics_to_org-1.0.3-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4c23e6d360f9014ee1440720374d1323e86690e949fbd287a55b0bd391e2a03
|
|
| MD5 |
b4b8a9984cac1fb1cc90ac6905895f26
|
|
| BLAKE2b-256 |
bf7730277802020e3140d1453380c25cda937ca0c5009f256d3212955d7686e2
|