{"id":38698598,"url":"https://github.com/txoof/calendar_csv","last_synced_at":"2026-01-17T10:44:11.328Z","repository":{"id":113295390,"uuid":"360233946","full_name":"txoof/calendar_csv","owner":"txoof","description":"calendar csv generator for schools","archived":false,"fork":false,"pushed_at":"2024-08-19T07:09:48.000Z","size":704,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-29T11:48:29.576Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/txoof.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-21T16:19:14.000Z","updated_at":"2025-02-20T00:27:12.000Z","dependencies_parsed_at":"2024-01-15T12:18:54.780Z","dependency_job_id":"484e41af-66a4-4ea1-a90d-1627f3d523a7","html_url":"https://github.com/txoof/calendar_csv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/txoof/calendar_csv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txoof%2Fcalendar_csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txoof%2Fcalendar_csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txoof%2Fcalendar_csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txoof%2Fcalendar_csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/txoof","download_url":"https://codeload.github.com/txoof/calendar_csv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txoof%2Fcalendar_csv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28506593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T10:25:30.148Z","status":"ssl_error","status_checked_at":"2026-01-17T10:25:29.718Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T10:44:10.594Z","updated_at":"2026-01-17T10:44:11.311Z","avatar_url":"https://github.com/txoof.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Calendar CSV Generator\n\nPython script for generating files suitable for import into Google Calendar based on a schedule files for N-day rotating block schedules. This script will produce one CSV for each unique event as well as a CSV for each day in the block rotation.\n\nFor example, if your rotating schedule has \"Block A, Block B, Block C, Lunch, Break 1, Break 2\" seven CSV files will be produced, one for each event in the rotation: e.g. Block A, Block B, Block C, lunch, breaks. Each file produced will contain all of the calendar events for all days that match that event.\n\nSee the [Sample CSV](./sample_csv/) directory in this repository for an example of an 8-day rotation with blocks A, B, C, D, E, F, G, H, Lunch, Flex Time and Breaks and several other events. This example is based on the [HS Bell Schedule](./bell_schedule_hs.csv) included.\n\n\n## Table of Contents \u003c!-- omit from toc --\u003e\n\n- [Google Calendar CSV Generator](#google-calendar-csv-generator)\n  - [Common Patterns \\\u0026 Use Case](#common-patterns--use-case)\n  - [Getting Started](#getting-started)\n  - [Use](#use)\n  - [Import CSV Files into Google Calendar](#import-csv-files-into-google-calendar)\n  - [Command Reference](#command-reference)\n  - [Additional Tools](#additional-tools)\n\n## Common Patterns \u0026 Use Case\n\nMany schools use a rotating schedule with an alternate, shortened time-table that is used on one day. In the example shown below, the schedule begins with a \"Day 1\" on the first day of school and continues 8 school-days before starting again. Weekends and holidays are not counted, only days that are considered \"instructional\" are counted.\n\nIn the example below, Wednesdays have an altered schedule with shorter blocks and an earlier dismissal time. Any time a school day falls on a Wednesday, a shortened version of the schedule is used.\n\n| Day 1 | Day 2 | Day 3 | Day 4 | Day 5 | Day 6 | Day 7 | Day 8 | Day 1 |\n|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|\n| Weds: 21/08/17 | Thurs: 21/08/18 | Fri: 21/08/19 | Mon: 21/08/23 | Tues: 21/08/24 | Weds: 21/08/25 | Thurs: 21/08/26 | Fri: 21/08/27 | Mon: 21/08/30 |\n| Alternate Sch. | Standard Sch. | Standard Sch. | Standard Sch. | Standard Sch. | Alternate Sch. | Standard Sch. | Standard Sch. | Standard Sch. |\n\nThe example [high schools](./bell_schedule_hs.csv) schedule has 8 instructional blocks (A..H), two breaks, a \"Flex\" block and Lunch. When run through this scrip, 14 CSV files will be produced, one for each instructional block, the flex, break and lunch blocks. Teachers can then import just the blocks that are relevant to their work (e.g. [A, B, D, F, H, Break 2, Flex] ). Additionally, a rotation_Day.csv is included. The rotation_day file includes \"all day\" events that indicate the rotation day as well as the N/Total school days.\n\nTo get started, check the HS or MS bell schedule files included in this repo and see the [Creating a CSV File](#creating-a-csv-file) below.\n\n## Getting Started\n\n### Novice Instructions \u003c!-- omit from toc --\u003e\n\n1. [Download this Zip File](https://github.com/txoof/calendar_csv/archive/refs/heads/master.zip)\n2. Unpack the zip file by double clicking on it in *Finder*\n3. Create (or update) the following files. It is easiest if the file names do **not** have any spaces.\n   - `bell_schedule.csv` - This file contains the bell schedule timing for each block (an example file is provided)\n   - `non_instruction.txt` - This file contains the dates in YYYY/MM/DD format that are considered \"non instructional\" such as conference days or PD days. \n4. Run the *Terminal.app* application (found in the applications folder)\n![Terminal](./Documentation/terminal.png)\n1. Type `cd` followed by a space in the terminal window\n2. Click on the unzipped folder in Finder and drag it into the terminal window. Then press `Enter` (`⏎` key).\n   - This will add the \"path\" to the program so you don't need to type it\n![drag folder](Documentation/drag_folder.gif)\n1. Paste the following command into the terminal window and press enter. **NOTE:** you may need to change the file names and dates to match your files and dates before pressing `Enter` (`⏎` key).\n   - `./gcal_csv_generator.py  --schedule_file ./school_schedule_file.csv\n   --start \"2022/08/17\" --end \"2023/06/16\" --non_instruction ./non_instruction.txt --alternate_day Wednesday`\n8. CSV files will appear on your desktop in a folder\n\n## Use\n\nYou will need the following:\n\n* Schedule file in [`.csv` format](./bell_schedule_hs.csv)\n  * Blank lines are ignored\n* Non-instructional days file \n  * [Flat file with one day per line in YYYY/MM/DD format](./non_instruction_sample.txt)\n  * Days that the rotation should \"skip\" such as holidays, parent-teacher conferences, PD Days, etc. Weekend days (Saturday \u0026 Sunday) are automatically skipped\n* First and Last date of the instructional term\n  * `YYYY/MM/DD` format: `2022/08/29`\n\n### Creating a Schedule file \u003c!-- omit from toc --\u003e\n\nTo create a CSV file, use the sample [CSV template](./bell_schedule_sample.csv) provided.\n\nSee the [HS Sample](./bell_schedule_hs.csvv) for a 8-Block rotation over 8 days with an alternate shortened schedule.\n\n**Required Columns:**\n\n- **`day`** Unique title of day in rotation (e.g. Day 1, Blue, Alpha, etc.)\n- **`subject`** Title of subject/block name (e.g. Block A, 3A Music, Lunch, etc.)\n- **`start`** Start time in HH:MM format (e.g. 13:55, 08:30)\n- **`end`** End time in HH:MM format\n- **`alternate`** this is an \"alternate\" schedule as boolean: (True/False/\\\u003cblank\\\u003e)\n- Any additional columns will be ignored\n\n#### Considerations When Creating a CSV Schedule File \u003c!-- omit from toc --\u003e\n\n- Use consistent names for the `subject` column. Events will be grouped based on the names. For example all events called *A Block* will be grouped in one file for import into a google calendar. If the file contains *A Block* in some places and *Block A* in others, they will be treated as different events. BE CONSISTENT.\n- Day names can be anything that suits your needs. Again, be consistent for sanity.\n\n\n### Generate Calendar CSV Files \u003c!-- omit from toc --\u003e\n\nExamples:\n\n- Generate a calendar based on `school_schedule_file.csv`, for a school year that begins on 8 August, 2022 and ends on 16 June 2023 with an alternate timing schedule on Wednesdays.\n\n```bash\n./gcal_csv_generator.py  --schedule_file ./school_schedule_file.csv \\\n--start \"2022/08/17\" --end \"2023/06/16\" --non_instruction ./non_instruction.txt \\\n--alternate_day Wednesday\n```\n\n- Generate a calendar based on `school_schedule_file.csv`, for a school year that begins on 8 August, 2022 and ends on 16 June 2023 with an alternate timing schedule on Tuesdays with a week that begins on Sunday and ends on Thursday.\n\n```bash\n./gcal_csv_generator.py  --schedule_file ./school_schedule_file.csv \\\n--start \"2022/08/17\" --end \"2023/06/16\" --non_instruction ./non_instruction.txt \\\n--alternate_day Wednesday --week_start Sunday --week_end Friday\n```\n\n## Import CSV Files into Google Calendar\n\nThe CSV files meet the specifications for Google Calendar and can be easily imported. See [Google's Excelent instructions for importing Events](https://support.google.com/calendar/answer/37118?hl=en\u0026co=GENIE.Platform%3DDesktop) for more information. Before continuing ***READ ALL OF THIS SECTION.***\n\nTeachers that need to add *Block A* to their calendar import the *Block_A.csv* file into their google calendar with no modifications. It is possible to modify the CSV file to make events easier to read in Google Calendar. See [Modifying CSV Files](#modifying-csv-files) below.\n\n### IMPORTANT WARNING \u003c!-- omit from toc --\u003e\n\nGoogle makes it very easy to import events, but there is **absolutely no way to undo an import**. Imported events must be manually deleted ONE-BY-ONE. It is prudent to create a \"test calendar\" and import your events for verification before commiting them to your personal calendar. **YOU HAVE BEEN WARNED.**\n\n### Modifying CSV Files \u003c!-- omit from toc --\u003e\n\nBy default, the CSV will add events to the calendar using the `subject` line provided in the schedule file. This will typically look something like \"Block B\" or \"Flex Time\" or \"AM Break\".\n\nTo make the events easier to read in your calendar, open the csv in Google Sheets, Excel, vim or your favorite stream editor and find/replace the subject with a title of your choice.\n\nFor example, if you teach \"Great Authors: Homer\" in Block B, and want \"Great Authors: Homer\" to appear on your calendar, do the following:\n\n1. Obtain a copy of the \"Block_B.csv\" file\n2. Open the file in your favorite editor (e.g. Google Sheets)\n3. Click: Edit \u003e Find and Replace\n4. In the Find and Replace dialogue find \"Block B\" and replace with \"Great Authors: Homer\"\n5. Export the file as a CSV and import into Google Calendar\n\n\nHere's a nice one-liner to do a find and replace with sed:\n```bash\n$ cat Block_B.csv | sed 's/Block B/Great Authors: Homer/g' \u003e great_authors.csv\n```\n\n## Command Reference\n\n```text\nUsage: gcal_csv_generator.py [-h] --schedule_file /schedule/file.csv --start \"YYYY/MM/DD\" --end \"YYYY/MM/DD\" --non_instruction /path/to/non_instruction.txt [--date_format \"%Y/%m/%d\"] [--alternate_day Wednesday] [--output /output/location/] [--week_start Monday-Sunday] [--week_end Monday-Sunday]\n\noptions:\n  -h, --help            show this help message and exit\n\n  --schedule_file /schedule/file.csv, -c /schedule/file.csv\n                        file containing CSV schedule data\n\n  --start \"YYYY/MM/DD\", -s \"YYYY/MM/DD\"\n                        First day of classes in YYYY/MM/DD format\n\n  --end \"YYYY/MM/DD\", -e \"YYYY/MM/DD\"\n                        Last day of classes in YYYY/MM/DD format\n\n  --non_instruction /path/to/non_instruction.txt, -n /path/to/non_instruction.txt\n                        File containing non-instructional days between start and end date, one per line matching the daytime format\n                        (YYYY/MM/DD)\n\n  --date_format \"%Y/%m/%d\", -d \"%Y/%m/%d\"\n                        datetime format see: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior\n\n  --alternate_day Wednesday, -a Wednesday\n                        single day to use \"alternate\" schedule specified in the schedule file\n\n  --output /output/location/, -o /output/location/\n                        Folder to use for output of CSV Schedules (default is ~/Desktop)\n\n  --week_start Monday-Sunday\n                        First day of a typical school week (e.g. Monday). Default: Monday\n\n  --week_end Monday-Sunday\n                        Last day of a typical school week (e.g. Friday). Default: Friday\n```\n\n## Additional Tools\n\nIncluded in this repo is a script that will combine multiple CSV files into a single CSV to simplify uploading to Google Calendar. Try `./combine.sh` for usage information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxoof%2Fcalendar_csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftxoof%2Fcalendar_csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxoof%2Fcalendar_csv/lists"}