Skip to content

National and regional holidays in multiple countries

License

Notifications You must be signed in to change notification settings

raphasampaio/Holidays.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Holidays.jl

Documentation CI codecov Aqua

Introduction

Holidays.jl is a lightweight Julia package designed for determining whether a specific date is a public holiday in a variety of countries. The package supports checking national and regional holidays, making it a perfect fit for applications that require accurate date-based calculations.

Currently Supported Countries

  • Brazil (including subdivisions)
  • Egypt
  • Germany (including subdivisions)
  • United States

Getting Started

Installation

julia> ] add Holidays

Example 1: United States

using Holidays
using Dates

usa_holidays = Holidays.UnitedStates()

# check if new year's day is a holiday
@show Date(2024, 1, 1) in usa_holidays # true

# check if memorial day is a holiday
@show Date(2024, 5, 27) in usa_holidays # true

# check if thanksgiving day is a holiday
@show Date(2024, 11, 28) in usa_holidays # true

Example 2: Brazil (Country and Subdivisions Holidays)

using Holidays
using Dates

# check if april 23rd is a holiday in brazil
brazil_holidays = Holidays.Brazil()
@show Date(2024, 4, 23) in brazil_holidays # false

# check if april 23rd is a holiday specifically in rio de janeiro
rio_holidays = Holidays.Brazil(subdivision = Subdivision.RioDeJaneiro())
@show Date(2024, 4, 23) in rio_holidays # true

Example 3: Find Holidays in a Specific Year Range

using Holidays

calendar = Holidays.UnitedStates()

@show Holidays.find_holidays(calendar, years = [2024, 2025])

Contributing

Contributions, bug reports, and feature requests are welcome! Feel free to open an issue or submit a pull request.

About

National and regional holidays in multiple countries

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages