holidayzer
v1.0.0
Published
A tool for managing holiday insertions in course schedules
Downloads
5
Readme
Holidayzer
A specialized tool for Ironhack course editors to manage holiday insertions in course schedules.
📋 Table of Contents
📖 Overview
Holidayzer is a robust automation tool designed to simplify the process of adjusting Ironhack course schedules when holidays occur. It ensures that schedules remain consistent, accurate, and well-organized, saving time and reducing errors.
✨ Features
- Automatically marks specific days as holidays in the schedule.
- Redistributes content across weeks to maintain balance.
- Renumbers weeks and days to ensure sequential consistency.
- Creates automated backups of the original file to prevent data loss.
- Provides detailed logging for transparency and debugging.
🎯 Problem Statement
Ironhack tech course schedules are defined in a structured index.yaml file, which organizes course content by weeks and days. When holidays occur during a course, the schedule needs to be adjusted by:
- Marking specific days as holidays.
- Rebalancing the remaining content across weeks.
- Ensuring proper sequential numbering of days and weeks.
Manually making these changes is time-consuming and error-prone, particularly when ensuring that day/week numbers remain consistent throughout the document.
💡 Solution
Holidayzer automates the process of inserting holidays into Ironhack course schedules by:
- Adding a holiday designation to a specific day.
- Redistributing days across weeks to maintain optimal content distribution.
- Renumbering all weeks and days to maintain sequential consistency.
- Creating automated backups of the original file to prevent data loss.
🛠️ Installation
Install the package globally using npm:
npm install -g holidayzerVerify the installation:
holidayzer --version
🚀 Usage
Run the tool using the holidayzer command:
holidayzer -w <week-number> -d <day-number> -f <path-to-index.yaml>Options:
-w, --week <number>: Week number where the holiday should be inserted.-d, --day <number>: Day number within the week to mark as a holiday.-f, --file <filename>: Path to the input YAML file (default:index.yaml).
Example:
holidayzer -w 2 -d 3 -f ./index.yaml📚 Examples
- In your terminal, insert a holiday on Week 2, Day 5 in the schedule:
$: holidayzer -w 2 -d 5 -f ./index.yaml
✨ Holidayzer process started ✨
• Validating arguments
→ validation for input file: "index.yaml", weekNum: 2, dayNum: 5
✓ arguments validation complete
• Generating backup file
→ Creating backup of "index.yaml" to "backup-index.yaml"
✓ Backup created successfully
• Reading and parsing input file
→ Successfully parsed 2578 lines from "index.yaml"
✓ File parsing complete
• Identifying week blocks in course file
→ Located 11 week blocks in course structure
✓ Week identification complete
• Extracting all day blocks from all weeks
→ Extracted 55 day blocks
✓ Day extraction complete
• Inserting holiday at Week 2, Day 5
→ Inserted holiday at position 9 (total days now: 56)
✓ Holiday designation complete
• Re-chunking days into weeks of 5 days each
→ Created 12 week blocks after re-chunking (1 additional weeks)
✓ Re-chunking complete
• Building new week blocks from updated day lines
→ Built 12 week blocks with 56 days in total
✓ Week block building complete
• Assembling final course structure with updated weeks and days
→ Composed output with 2702 lines
✓ Output composition complete
• Identifying week blocks in course file
→ Located 12 week blocks in course structure
✓ Week identification complete
• Updating week and day numbering for consistency
→ Renumbered 12 weeks and 56 days
✓ Renumbering complete
• Writing updated schedule to "index.yaml"
→ Updated schedule saved to index.yaml
✓ File writing complete- before and after
index.yamlupdate
// before
# Week 2
- name: "Day 5" ##### M1 - W2 - D5 #####
vertical:
- name: ...
- name: "DOM | Race Car Game"
- name: "[LAB] LAB | DOM Race Car"
- name: ...
# Week 3
- name: "Day 1" ##### M1 - W3 - D1 #####
vertical:
- name: ...
- name: "CodeWars - Intro"
- name: "[KATA] Code interview test: Anagrams"
- name: ...
- name: "Day 2" ##### M1 - W3 - D2 #####
vertical:
- name: ...
- name: "[KATA] Code interview test: Clocky Mc Clock-Face"
- name: "[PROJECT] Project development"
- name: ...
# !Week 11 (last week)
- name: "Day 5" ##### M4 - W11 - D5 #####
vertical:
- name: ...
- name: "[PROJECT] Presentations - Project #4"
- name: "[PROJECT] Project 4 Deliverables/GitHub repo-SERVER"
- name: ...
// after // flagged the day as a Holiday
# Week 2
- name: "Day 5 [Holiday]" ##### M1 - W2 - D5 #####
vertical:
- name: ...
- name: "DOM | Race Car Game"
- name: "[LAB] LAB | DOM Race Car"
- name: ...
# Week 3 // the same content as Week 2 day 5
- name: "Day 1" ##### M1 - W3 - D1 #####
vertical:
- ...
- name: "DOM | Race Car Game"
- name: "[LAB] LAB | DOM Race Car"
- ...
- name: "Day 2" ##### M1 - W3 - D2 ##### // Week 3 day 1 shifted one day
vertical:
- ...
- name: "CodeWars - Intro"
- name: "[KATA] Code interview test: Anagrams"
- ...
# !Week 12 (last week) // created a new week
- name: "Day 1" ##### M4 - W11 - D5 #####
vertical:
- name: ...
- name: "[PROJECT] Presentations - Project #4"
- name: "[PROJECT] Project 4 Deliverables/GitHub repo-SERVER"
- name: ...⚠️ Constraints
- The input file must follow the
index.yamlstructure used in Ironhack courses. - Ensure the file is properly formatted to avoid parsing errors.
🛡️ Error Handling
Holidayzer provides detailed error messages and logs to help identify and resolve issues. Common errors include:
- Invalid file path or format.
- Invalid week or day number.
- Specified day is already marked as a holiday.
🔍 How It Works
- Parses the
index.yamlfile to identify weeks and days. - Marks the specified day as a holiday.
- Redistributes remaining content across weeks.
- Renumbers weeks and days for consistency.
- Saves the updated schedule to the original file or a backup.
🤝 Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m "Add your feature description" - Push to your branch:
git push origin feature/your-feature-name - Open a pull request.
📜 License
This project is licensed under the MIT License. See the LICENSE file for details.
⚠️ This is a private proprietary package. Not intended for public use or redistribution.
