Skip to main content

larzical

iCalendar (RFC 5545) — build and parse .ics — with zero dependencies.

Generate calendar invites and feeds that Google Calendar, Apple Calendar and Outlook accept, and parse the ones they send you. larzical implements the parts of RFC 5545 that matter in practice — and the details hand-rolled .ics generators get wrong: correct TEXT escaping, 75-octet line folding (multibyte-safe), UTC date-times, and CRLF endings.

Install

pip install larzical

Use

from larzical import Calendar, Event, Alarm
from datetime import datetime, date

cal = Calendar(prodid="-//Acme//App//EN", name="Team")
cal.add(Event(
    summary="Launch call",
    start=datetime(2026, 8, 1, 15, 0),
    end=datetime(2026, 8, 1, 16, 0),
    location="Zoom",
    description="Kickoff; agenda attached.",
    attendees=["a@x.com", "b@x.com"],
    alarms=[Alarm(trigger="-PT15M")],
))
cal.add(Event(summary="Company holiday", start=date(2026, 12, 25)))  # all-day

ics = cal.to_ical()               # a valid .ics string, folded + CRLF
Calendar.parse(ics)               # round-trips back to Events

Why it's correct

.ics files fail silently in calendar clients when the low-level rules are wrong. larzical is anchored to the spec:

  • TEXT escaping (3.3.11) — , ; \ and newlines escaped/unescaped.
  • Line folding (3.1) — content lines folded at 75 octets with CRLF , and never split in the middle of a multibyte character.
  • Date-time (3.3.5) — UTC YYYYMMDDTHHMMSSZ; all-day as VALUE=DATE.
  • Round-tripCalendar.parse(cal.to_ical()) reconstructs the events.

Tests

python -m unittest discover -s tests -v   # 17 tests

The Larz stack

One of 60+ pure-Python, zero-dependency libraries at github.com/larz-scripter. Pairs with larzqr (add a scannable event QR) and larzemail (attach the invite to a MIME email).

License

MIT (c) larz-scripter

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

larzical-0.1.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

larzical-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file larzical-0.1.0.tar.gz.

File metadata

  • Download URL: larzical-0.1.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for larzical-0.1.0.tar.gz
Algorithm Hash digest
SHA256 20aad171f150d42205bfc09e444998ee38bb05c7bde34542efdde06cc7d7bd3a
MD5 991103016fdd8f595cca4b315f6c26d7
BLAKE2b-256 d256bc86541c8f2609c735491e8b7c717f8d5de6cedd3cc4ad512f789f53bca3

See more details on using hashes here.

File details

Details for the file larzical-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: larzical-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for larzical-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64d2b838f133b0a687c214cd34bd59a9cd8a083d3895fb285a218586e0136cd8
MD5 7dd943620356eee0a47b5aa30b99c4dc
BLAKE2b-256 1331a4e9a1b1a45ebcfad30e76dfb35acd8e3f503091ed88d40d1e0d868e6c81

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page