Skip to main content

Fix slightly broken iCalendar files

Project description

ics-fixer

This program will fix common issues with ICS files that prevent programs such as Mozilla Thunderbird from parsing them.

Usage: ics-fixer [OPTIONS] INPUT_FILE [OUTPUT_FILE]

Arguments:
  INPUT_FILE     Path to the input ICS file.  [required]
  [OUTPUT_FILE]  Path for the output file. If omitted, the input file is
                 overwritten.

Options:
  --skip-mojibake-fix             Do not run the mojibake (garbled text)
                                  fixer.
  --debug                         Enable debug logging.
  --help                          Show this message and exit.

Installation

uv is recommended to install the package in a managed environment:

uv tool install ics-fixer

Dependencies

  • Python >= 3.13
  • dateparser
  • ftfy
  • icalendar
  • typer

Notes

These fields may contain desired data but will be discarded if it is incorrectly formatted:

  • Event orgainizer
  • Event attendee list

In my use case, this is acceptable as I have only encountered ICS files where malformed ORGANIZER or ATTENDEE values were useless.

If start or end time is in the wrong format and can't be parsed, the current time at the program's execution will be substituted.

If the start and end time are equal and contain the time, the end time will be shifted one hour, as some programs do not work properly with 0-length events. If the intention is an all-day event, the end time should be 24 hours after the start time.

Potential Implementations

  • Unit tests
  • Support for older Python versions
  • Timezone shifter for dates incorrectly assumed as UTC
  • Force all-day mode for events with same start and end time
  • Better fixes for malformed ORGANIZER or ATTENDEE
    • I would need real world sample data

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

ics_fixer-1.0.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

ics_fixer-1.0.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file ics_fixer-1.0.1.tar.gz.

File metadata

  • Download URL: ics_fixer-1.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for ics_fixer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 88998f081084105875d2351287504f9f332ee0eb049638c9a85c1a020c0e132e
MD5 957b667cad96fcf43bdc045515cdb529
BLAKE2b-256 3fe640ac67401722065edaacd04c2103a9da8b2c8fcfb8103e1aca5ed71fa7fe

See more details on using hashes here.

File details

Details for the file ics_fixer-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ics_fixer-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for ics_fixer-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 187d194ee4356f16cb41e43ed87c8890183f452d96ed4282f10aeb532369a8d5
MD5 4587a5ba5ab015d8cec23c917be2f88c
BLAKE2b-256 cdbe51d5583cfcfd3ad733ad5f6a7e521bfa81f37dbd673376ae4d840832cb5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page