mrkeyoor.com_
Tue 22 Sept 18:49 UTC
PyPIUtilsupdated 22 Sept 2026

holidays review

holidays 0.103 builds local Python mappings from dates to government holiday names for 250 country codes, with subdivisions, languages, and extra categories available only where each calendar implements them. It also has named financial-market calendars, though those contain holiday dates rather than trading sessions. Version 0.103 adds NZX and TWSE, changes the Holi 2026 date for NSE and BSE, and updates holidays in Gujarat and Maharashtra. Our Python 3.12 check imported it in 0.34 seconds and found packaged typing metadata.

Verdict

Our holidays 0.103 install took 0.5 seconds, used 9 MB across 3 packages, imported in 0.34 seconds, and had no known audit findings. Use it for pinned, tested holiday lookups; use official rules for legal deadlines and a session calendar for trading hours.

We installed it

Lab card: what happened when we installed holidaysScreenshot of holidays documentation
Install✓ · 0.5s3 packages on disk · 9 MB
Importimport holidays in 0.34s · pure Python · py.typed · requires Python >=3.10
Known vulns0(pip-audit)

Answers from our run

Does holidays install cleanly?

Yes. In a fresh container with an empty cache, pip install holidays finished in 0.5s, leaving 3 packages and 9 MB on disk. pip-audit reported no known vulnerabilities.

What does holidays need to run?

Python >=3.10, and nothing compiled: it is pure Python. In our run import holidays succeeded in 0.34s, and the package ships py.typed for type checkers.

holidays or workalendar: which should you use?

workalendar: Use it when its calendar classes and business-day methods cover your jurisdictions better. Our holidays 0.103 install took 0.5 seconds, used 9 MB across 3 packages, imported in 0.34 seconds, and had no known audit findings.

When should you not use holidays?

Payroll, tax, filing, or settlement output requires an official legal source; a community rules package cannot certify a deadline

API stability4/5HolidayBase still behaves like a date-to-name mapping, while country_holidays() and financial_holidays() expose the established years, subdivision, observed, expand, language, and categories controls. The package remains on a 0.x release line, and data corrections are part of its normal work. Version 0.103 changed the 2026 Holi result for NSE and BSE without needing a new calling pattern, so output fixtures matter as much as signature compatibility.
Docs5/5The official Read the Docs site returns HTTP 200 and covers construction, country support, subdivisions, languages, categories, observed dates, expansion, working-day helpers, financial markets, customization, and ICS output. Its large support table names capabilities for each country instead of promising uniform behavior. Readers still need to inspect the exact jurisdiction row, since an example from one country does not establish another country's aliases or categories.
Maintenance5/5PyPI published 0.103 on August 17, 2026, and GitHub shows another repository push on August 25, 2026. The unarchived project has 1,920 stars and 79 open issues and pull requests combined. That release added New Zealand Exchange and Taiwan Stock Exchange calendars, corrected Indian exchange data, and updated two Indian states. The dev branch and prerelease process give rule changes a visible route before a stable package cut.
Ecosystem5/5The package documents 250 country codes plus jurisdiction-specific subdivisions, languages, categories, and selected financial markets. Its mapping interface fits ordinary datetime code without a service account or network request, and the installed distribution provides py.typed. Coverage is broad rather than uniform: payroll authority, company closures, and market sessions remain separate jobs, which is why companion packages and official calendars still belong in serious scheduling systems.

Use it if

  • A Python service needs public-holiday membership and names for a supported country and subdivision without calling a remote API
  • Working-day arithmetic should use the same calendar object as date membership and observed-day handling
  • The project support table explicitly lists the language and category your jurisdiction needs
  • A financial-market holiday list is enough and you do not need opens, closes, breaks, or early sessions
Skip it if

Setup reality

We installed holidays 0.103 in a fresh Python 3.12 Bookworm sandbox in 0.5 seconds. The environment ended with 3 packages occupying 9 MB. The distribution has one direct dependency, requires Python 3.10 or newer, and is pure Python. It ships py.typed, so type checkers can use its inline annotations. pip-audit reported zero known vulnerabilities, and import holidays completed in 0.34 seconds. Our package measurement could not identify a license from the installed metadata.

Construction choices determine the data you receive. Set the country, subdivision, years, observed policy, language, and categories explicitly. Country identifiers mainly follow ISO 3166-1, while subdivision aliases and extra categories vary by implementation. PUBLIC is the ordinary category. Passing BANK, SCHOOL, or another constant only makes sense when that country row documents it. Language fallback is also calendar-specific, so store codes rather than assuming one global default.

The default object can change during a read. With expand enabled, asking about a date in 2028 can calculate that year and append its holidays to an object initially built for 2027. Supply the full year range and use expand=False when stable iteration matters. observed defaults to true, and changing it later recalculates entries. Although strings and Unix timestamps are accepted, normalizing external input to datetime.date avoids ambiguous date strings at application boundaries.

Holiday rules are data, so an upgrade can change old output without breaking an import or method call. Version 0.103 corrected Holi in 2026 for two Indian exchanges and added two market calendars. Pin the package used for a generated schedule, record that version with exported results, and test dates that matter to the business. Financial calendars still need a session-calendar source when hours or early closes affect execution.

Patterns

Load one country and year load-country

import holidays

us = holidays.country_holidays('US', years=2026)
for day, name in sorted(us.items()):
    print(day, name)

Passing 2026 makes the initial mapping predictable; add expand=False if later reads must not insert another year.

Check a normalized calendar date check-date

from datetime import date
import holidays

calendar = holidays.country_holidays('US', years=2026)
day = date(2026, 7, 4)
name = calendar.get(day)
if name is not None:
    print(name)

HolidayBase accepts several input forms, but datetime.date avoids locale ambiguity at a service boundary.

Pick a documented subdivision choose-subdivision

import holidays

california = holidays.country_holidays(
    'US', subdiv='CA', years=range(2026, 2029)
)

US subdivision CA is explicit here; codes and aliases differ between country implementations.

Remove observed substitute days exclude-observed

import holidays

calendar = holidays.country_holidays(
    'US', years=2026, observed=False
)

observed defaults to true, and changing the property after creation can rebuild entries in the mapping.

Prevent lazy year expansion disable-expansion

import holidays

calendar = holidays.country_holidays(
    'US', years=[2026, 2027], expand=False
)
assert calendar.get('2028-01-01') is None

With expand=False, the 2028 lookup stays absent instead of adding a third year during a read.

Request one supported language localize-names

import holidays

spain = holidays.country_holidays(
    'ES', years=2026, language='es'
)

The selected country controls supported_languages and fallback behavior; language availability is not global.

Combine implemented categories select-categories

from holidays import BANK, PUBLIC, country_holidays

belgium = country_holidays(
    'BE', years=2026, categories=(PUBLIC, BANK), language='en_US'
)

Belgium documents BANK alongside PUBLIC; validate categories against the chosen calendar before accepting configuration.

Test a working day check-working-day

import holidays

calendar = holidays.country_holidays('US', years=2026)
if calendar.is_working_day('2026-12-18'):
    print('open')

This result follows the calendar's weekend and holiday rules, which may differ from an employer's schedule.

Advance a deadline by workdays advance-working-days

import holidays

calendar = holidays.country_holidays('US', years=[2026, 2027])
due = calendar.get_nth_working_day('2026-12-18', 10)
print(due)

Load 2026 and 2027 because a ten-day calculation near year end can cross into January.

Read a market holiday load-financial-market

import holidays

nyse = holidays.financial_holidays('NYSE', years=2026)
print(nyse.get('2026-12-25'))

NYSE here returns dates and labels, not regular hours, breaks, or early closing times.

Search the displayed holiday name find-by-name

import holidays

calendar = holidays.country_holidays('US', years=2026, language='en_US')
dates = sorted(calendar.get_named('Thanksgiving'))
print(dates)

Name matching depends on the chosen language and rule data; persist dates or business identifiers when wording can change.

Append an internal closure append-company-closure

from datetime import date
import holidays

calendar = holidays.country_holidays('US', years=2026)
calendar.append({date(2026, 12, 24): 'Company closure'})

Keep company closures separately attributable even when the application combines them with public holidays.

Alternatives

PackageRegistryPick it when
workalendarPyPIUse it when its calendar classes and business-day methods cover your jurisdictions better
pandas-market-calendarsPyPIUse it for exchange schedules with opens, closes, breaks, and early sessions
business-calendarPyPIUse it for a small calendar assembled from your own workdays and closure dates

More utils guides

lru-cache · ajv · type-fest · p-limit · find-up · js-yaml · the whole shelf →

How this guide is made: grounded in the library's documentation, release notes, changelog, and issue history, on a fixed rubric — not a hands-on install of every release. The 50 most-downloaded entries are additionally install-verified in clean containers. Corrections: contact the desk.