Convert Schedule to .ics

This is the small project for convert schedule to .ics files.

The relevant note are here:

Python Script

This Python script is designed to process textual input describing events, convert it into a structured schedule, and then generate .ics (iCalendar) files for each event. These files are then bundled into a ZIP file for download. Let's break down the script into its key components using Markdown:

source code here

Importing Libraries

from icalendar import Calendar, Event
import pytz
from datetime import datetime, timedelta
import re
import io
import zipfile

Function: create_ics_file

def create_ics_file(event_details, start_date, end_date):
    ...

Function: parse_input

def parse_input(input_text):
    ...

Function: parse_and_create_ics_files

def parse_and_create_ics_files(schedule, start_date, end_date):
    ...

Function: schedule_to_ics

def schedule_to_ics(request):
    ...

Summary

The script is a complete solution for converting text-based event descriptions into downloadable iCalendar files. It handles input parsing, date and time manipulation, file creation, and HTTP response generation. The use of timezone-aware datetime objects ensures accurate scheduling across different regions.

Local Version

Source code here

Most logic are same but the local version just need you save your code into .txt file and inout start time and end time by hand.