RepositoryPHPJPJapan
AZ

azuyalabs/yasumi

The easy PHP Library for calculating holidays

1.1kstars
170forks
5issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: provider-holidays

#1 Repository of the week

1
TINIX TRENDING·Topic: holiday

#1 Repository of the week

1
TINIX TRENDING·Topic: holidays

#1 Repository of the week

GitHub Release Total Downloads Coding Standard Static analysis Testing Software License

Logo

Introduction

Yasumi (Japanese for 'Holiday'「休み」) is the easy PHP library that helps you retrieve the dates and names of holidays and other special celebrations from various countries/states. It is calculation and rule driven avoiding the need of a comprehensive database.

Many services exist that can provide holiday information, however are either not entirely free or only offer limited information. In addition, no exhaustive PHP library exists today covering a wide range of holidays and countries. PEAR's Date_Holidays library was a similar attempt, however it hasn't been updated for a long time.

Requirements

Yasumi requires PHP 8.2 or higher. The library supports PHP 8.2, 8.3, 8.4, and 8.5.

For detailed information about supported PHP versions and security updates, please refer to the SECURITY.md file.

Installation

Install Yasumi using Composer:

composer require azuyalabs/yasumi

Quick Start

Here's a simple example to get you started:

<?php

require 'vendor/autoload.php';

// Create a holiday provider for a specific country and year
$holidays = Yasumi\Yasumi::create('USA', 2026);

// Get all holidays for the year
foreach ($holidays as $holiday) {
    echo $holiday->getName() . ': ' . $holiday->format('Y-m-d') . PHP_EOL;
}

// Get a specific holiday
$independenceDay = $holidays->getHoliday('independenceDay');
echo $independenceDay->getName() . ' is on ' . $independenceDay->format('F j, Y') . PHP_EOL;

// Check if a date is a holiday
$newYearsDay = $holidays->getHoliday('newYearsDay');
if ($newYearsDay !== null) {
    echo 'New Year\'s Day is a holiday!' . PHP_EOL;
}

For more examples, check the examples directory in the repository.

Highlights

The goal of Yasumi is to be powerful while remaining lightweight, by utilizing PHP native classes wherever possible. Yasumi's calculation is provider-based (i.e. by country/state), making it easy to add new holiday providers that calculate holidays.

  • Pure PHP with a straightforward API
  • Framework-agnostic
  • Use of Providers to easily extend and expand new Holidays
  • Common Holiday Providers (e.g. Christian Holidays)
  • Accounts for the date/time when holidays have been officially established and/or abolished
  • Filters enabling to easily select certain holiday types (Official, Observed, Bank, Seasonal or Other)
  • Global Translations
  • Time zone aware
  • Implements ArrayIterator to easily process a provider's holidays
  • Fully documented
  • Fully unit tested
  • Composer ready, PSR-12 and PSR-4 compliant

Documentation

Yasumi’s documentation is available on https://www.yasumi.dev. You will find all the necessary information how to install Yasumi and also recipes how you can use Yasumi in your project.

Contributing

Contributions are encouraged and welcome; I am always happy to get feedback or pull requests on GitHub :) Create GitHub Issues for bugs and new features and comment on the ones you are interested in.

If you enjoy what I am making, an extra cup of coffee is very much appreciated :). Your support helps me to put more time into Open-Source Software projects like this.

Buy Me A Coffee

License

This project is open-sourced software licensed under the MIT License (MIT). Please see LICENSE for more information.

Similar Projects

Discover other similar projects and AI models.

RepositoryC#
nager/Nager.Date

Easily access public holidays for 200+ countries via .NET, REST API, Docker, or NuGet for online and offline use.

1.4k
Nov 25, 2026
RepositoryJava
focus-shift/jollyday

Jollyday - A worldwide public holidays library

144
Nov 26, 2026
RepositoryJavaScript
commenthol/date-holidays

worldwide holidays

1.1k
Nov 29, 2026
RepositoryRuby
billaul/active_period

Smart-Period aims to simplify Time-range manipulation

78
Aug 14, 2025
RepositoryPython
GothenburgBitFactory/holidata

Holidata is the core of holidata.net, a no-nonsense, ad-free provider of international holiday data.

59
Nov 15, 2026
RepositoryPython
public-apis/public-apis

A collective list of free APIs

502.6k
Nov 30, 2026
RepositoryJavaScript
react/react

The library for web and native user interfaces.

253.0k
Nov 30, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryPython
yt-dlp/yt-dlp

A feature-rich command-line audio/video downloader

212.4k
Dec 2, 2026