A Python script that scrapes the Royal Conservatory of Music's website for free student recitals and community performances and generates an iCalendar (.ics) file. This allows you to easily add and stay updated with the latest free concert schedules in your favorite calendar application.
Note
The public calendar is updated every hour. For real-time updates, subscribe to the calendar and enable event change notifications in your calendar app.
You can easily subscribe to the concert calendar without running the script yourself.
The main.py script performs the following steps:
- Fetches HTML: It sends an HTTP GET request to the RCM's student recitals and community performances page.
- Parses HTML: Using
BeautifulSoup, it parses the HTML content and extracts the table containing the concert schedule. - Converts to JSON: The extracted HTML table is converted into a JSON format for easier data manipulation.
- Generates iCalendar file: It iterates through the concert data, creating an iCalendar
Eventfor each entry. - Saves the file: The script saves the generated calendar as
calendars/all_concerts.ics.
If you want to run the script yourself, follow these instructions.
- Python 3.11 or higher
-
Clone the repository:
git clone https://github.com/your-username/rcmusic-free.git cd rcmusic-free -
Create and activate a virtual environment:
# Create the virtual environment python -m venv venv # Activate on Windows .\venv\Scripts\Activate.ps1 # Activate on macOS/Linux source venv/bin/activate
-
Install the required packages:
pip install -r requirements.txt
-
Run the script:
python main.py
This will create the
all_concerts.icsfile inside thecalendarsdirectory. You can then import this file into any calendar application that supports the iCalendar format (e.g., Google Calendar, Apple Calendar, Outlook).
Note
An iCal file generated manually will not be updated automatically. You will need to run the script again and re-import it to your calendar app to get the latest schedule. To stay updated automatically, use the subscription links provided above.