Skip to main content

Maximize time off by smart linking public holidays and weekends.

Project description

🌴 Vacation Extender 📅

Maximize Your Time Off. Smartly connect public holidays and weekends for the longest possible vacations.


🚀 Overview

VacationExtender is a smart scheduling program designed to optimize your annual leave. By analyzing public holidays and fixed weekend dates, it identifies the best days to take off, allowing you to "bridge" short working periods and create maximum-length holiday streaks from minimal paid time off.

Perfect for travelers, remote workers, and anyone looking to get the most value out of their vacation days!

✨ Key Features

  • Minimal PTO Usage: Prioritizes solutions that yield the longest rest period for the lowest number of paid days used.
  • Localization Ready: Easily adaptable to different countries' holiday calendars. (Currently configured for Brazil/Global demo, but easily extendable!)
  • Simple Output: Provides clear date ranges and the resulting total days of vacation.

🛠️ Installation & Usage (Example for Python)

(Note: Adjust these steps based on the actual language and structure of your program. If it's a Python package, include pip install; if it's a script, show how to run it.)

Prerequisites

  • [e.g., Python 3.x]

Getting Started

  1. Clone the repository:

    git clone [https://github.com/YourUsername/VacationExtender.git](https://github.com/YourUsername/VacationExtender.git)
    cd VacationExtender
    
  2. Install the editable mode:

    pip install -e .
    
  3. Run the core script:

    # Example command to run the optimizer for the next year
    vacationext
    

Expected Output

The program will output a suggested schedule, such as:

==========================================================================================
🌴 EXTENDED VACATION (option 1) 📅
==========================================================================================
BEGIN BREAK  END BREAK    BEGIN PTO    END PTO         PTO  TOTAL        ROI      SCORE
------------------------------------------------------------------------------------------
2026-02-14   2026-02-22   2026-02-19   2026-02-20        2      9       4.50      13.50
2026-10-31   2026-11-08   2026-11-05   2026-11-06        2      9       4.50      13.50
2026-11-20   2026-12-31   2026-11-23   2026-12-18       26     42       1.62      10.47
------------------------------------------------------------------------------------------
USED PTO: 30 / 30
TOTAL BREAK DAYS: 60
AVERAGE ROI: 2.00 break days / PTO days
==========================================================================================

🤝 Contribution

We welcome contributions! Whether it's adding a new country's holiday calendar, improving the optimization algorithm, or enhancing the documentation, your help is appreciated.

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

📄 License

Distributed under the MIT License. See LICENSE for more information.


⚙️ Configuration File (config.toml)

The config.toml file is the primary way to define the optimization parameters, including the target calendar, location, and user-specific PTO constraints. You can run the optimizer with a custom configuration file path using the command line (e.g., python main.py --config config_us.toml).


📅 [CALENDAR]

These parameters define the basic time structure for the optimization.

Parameter Type Default Description
year Integer 2026 The target year for which the vacation plan will be generated.
weekend List of Integers [5, 6] Defines non-working days. 0 is Monday, 6 is Sunday.

🌍 [LOCATION]

These settings tell the VacationExtender which public holiday calendar to load using the holidays library.

Parameter Type Default Description
country_code String "BR" The ISO 3166-1 alpha-2 code (e.g., "US", "DE", "BR").
subdivision_code String "SP" Optional code for state/province holidays. Use "" for country-only holidays.
include_observed Boolean false If holidays that fall on a weekend should be shifted and observed on the next weekday (common in the US).

🚧 [CONSTRAINTS]

This section defines the user's budget and specific rules for suggesting optimal vacation periods.

Parameter Type Default Description
vacation_days Integer 30 The total PTO (Paid Time Off) budget available for the year. The algorithm will stop when this budget is depleted.
max_vac_periods Integer 3 The maximum number of separate vacation periods (breaks) the algorithm should suggest.
max_vac_days_per_break Integer -1 The maximum number of PTO days you are willing to spend for a single continuous break. Use -1 for no limit.
min_vac_days_per_break Integer 1 The minimum number of PTO days required to be used for a period to be considered a bridge suggestion.
min_total_days_off Integer 1 The minimum number of TOTAL days off (PTO + holidays + weekend) that a suggested period must include.
max_total_days_off Integer -1 The maximum number of TOTAL days off (PTO + holidays + weekend) that a suggested period can include. Use -1 for no limit.
min_gap_days Integer 0 The minimum number of days between two vacation periods.
top_n_suggestions Integer 1 The number of vaccation suggestions.
in_holiday_as_pto Boolean false If true, Fixed Days Off (holidays/weekends) inside a continuous vacation span are charged against the PTO budget. If false, only working days consume PTO.
custom_holidays List of Strings [] List of additional non-working days. Supports single days ("YYYY-MM-DD") or ranges ("YYYY-MM-DD:YYYY-MM-DD").
forced_work List of Strings [] List of dates or intervals where work is mandatory. Supports single days ("YYYY-MM-DD") or ranges ("YYYY-MM-DD:YYYY-MM-DD").

⚙️ [ALGORITHM]

This section configures the type of optimization algorithm and the specific scoring rule used to prioritize potential vacation breaks.

Parameter Type Default Description
algorithm_type str optimal optimal: Uses Dynamic Programming to find the mathematical global maximum. greedy: Selects best ROI first (Fast, heuristic-based).
duration_weight_factor_alpha float 0.5 The Alpha Factor ($\alpha$) that weights break duration. It calculates priority with the Score $P = \eta \times T^{\alpha}$. Values $\alpha > 0$ penalize short breaks and prioritize longer vacation periods ($T$). Use $0$ for Pure Efficiency ($\eta$).

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

vacation_extender-0.1.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

vacation_extender-0.1.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file vacation_extender-0.1.0.tar.gz.

File metadata

  • Download URL: vacation_extender-0.1.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.12.3 HTTPX/0.28.1

File hashes

Hashes for vacation_extender-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4284f654928f3e1377a4b42771e963e96384fca873b59f9e2174f9c424d3dc20
MD5 50ab70a12d9108f6738e649950c09af6
BLAKE2b-256 23112833486fc7b53ba12e8b441181b0279b40b93addb0f49ffbe376f8fd6b20

See more details on using hashes here.

File details

Details for the file vacation_extender-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vacation_extender-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.12.3 HTTPX/0.28.1

File hashes

Hashes for vacation_extender-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9296d3fd1f72d422053928d324c7cee22d22ec7e23d7f887f4f5d3bead631bbe
MD5 5764ee26be4b5ef2ead8597f49162a24
BLAKE2b-256 78b7412d7c00d1113e30c8c8b41f94941025ec320c91bf861a2abbb74c7648c3

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