### Install Holidays.jl Package Source: https://github.com/raphasampaio/holidays.jl/blob/main/docs/src/getting_started.md Installs the Holidays.jl package using the Julia package manager. ```julia julia> ] add Holidays ``` -------------------------------- ### Install Holidays.jl Package Source: https://github.com/raphasampaio/holidays.jl/blob/main/README.md Demonstrates how to add the Holidays package to a Julia environment using the package manager. ```julia julia> ] add Holidays ``` -------------------------------- ### Install Holidays.jl Package Source: https://github.com/raphasampaio/holidays.jl/blob/main/docs/src/index.md This snippet shows how to add the Holidays package to your Julia environment using the package manager. ```julia pkg> add Holidays ``` -------------------------------- ### Find Holidays in Specific Year Ranges Source: https://github.com/raphasampaio/holidays.jl/blob/main/README.md Demonstrates how to use the `find_holidays` function to retrieve a list of holidays for a specified range of years, using the United States as an example. ```julia using Holidays calendar = Holidays.UnitedStates() @show Holidays.find_holidays(calendar, years = [2024, 2025]) ``` -------------------------------- ### Check Global Holidays Source: https://github.com/raphasampaio/holidays.jl/blob/main/README.md Provides examples of checking holidays across various countries including the United States, Canada, France, Australia, China, Japan, India, and Russia. ```julia using Holidays using Dates @show Date(2024, 7, 4) in Holidays.UnitedStates() # Independence Day - true @show Date(2024, 7, 1) in Holidays.Canada() # Canada Day - true @show Date(2024, 7, 14) in Holidays.France() # Bastille Day - true @show Date(2024, 1, 26) in Holidays.Australia() # Australia Day - true @show Date(2024, 10, 1) in Holidays.China() # National Day - true @show Date(2024, 5, 5) in Holidays.Japan() # Children's Day - true @show Date(2024, 8, 15) in Holidays.India() # Independence Day - true @show Date(2024, 5, 9) in Holidays.Russia() # Victory Day - true ``` -------------------------------- ### Compare Holidays Across Different Countries Source: https://github.com/raphasampaio/holidays.jl/blob/main/docs/src/getting_started.md Shows how to check the same date against holiday calendars of different countries, and how to check for country-specific holidays. ```julia using Holidays using Dates # Check the same date across different countries australia_day = Date(2024, 1, 26) @show australia_day in Holidays.Australia() # true - Australia Day @show australia_day in Holidays.UnitedStates() # false @show australia_day in Holidays.Canada() # false # Check country-specific holidays @show Date(2024, 7, 1) in Holidays.Canada() # Canada Day - true @show Date(2024, 7, 14) in Holidays.France() # Bastille Day - true @show Date(2024, 4, 25) in Holidays.Australia() # ANZAC Day - true @show Date(2024, 5, 5) in Holidays.Japan() # Children's Day - true ``` -------------------------------- ### Find All Holidays in a Specific Year Source: https://github.com/raphasampaio/holidays.jl/blob/main/docs/src/getting_started.md Demonstrates how to retrieve a list of all holidays for a given country and year using the `find_holidays` function. The output includes the label for each holiday. ```julia using Holidays # Get all holidays for a specific year calendar = Holidays.UnitedStates() holidays_2024 = Holidays.find_holidays(calendar; years = [2024]) println("US Federal Holidays in 2024:") for holiday in holidays_2024 println("$(holiday.label)") end ``` -------------------------------- ### Handle Country Subdivisions for Holidays Source: https://github.com/raphasampaio/holidays.jl/blob/main/docs/src/getting_started.md Illustrates how to use subdivisions (like states or provinces) to check for regional holidays in countries like Brazil and Germany. ```julia using Holidays using Dates # Brazil with state-specific holidays brazil_national = Holidays.Brazil() brazil_rio = Holidays.Brazil(subdivision = Subdivision.RioDeJaneiro()) st_george_day = Date(2024, 4, 23) @show st_george_day in brazil_national # false - not a national holiday @show st_george_day in brazil_rio # true - state holiday in Rio de Janeiro # Germany with state-specific holidays germany_national = Holidays.Germany() germany_bavaria = Holidays.Germany(subdivision = Subdivision.Bavaria()) epiphany = Date(2024, 1, 6) @show epiphany in germany_national # false - not a national holiday @show epiphany in germany_bavaria # true - state holiday in Bavaria ``` -------------------------------- ### Check Brazil Holidays (Country and Subdivisions) Source: https://github.com/raphasampaio/holidays.jl/blob/main/README.md Illustrates checking for holidays in Brazil, both nationally and for specific subdivisions like Rio de Janeiro. ```julia using Holidays using Dates # check if april 23rd is a holiday in brazil holidays = Holidays.Brazil() @show Date(2024, 4, 23) in 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 ``` -------------------------------- ### Check if a Date is a Holiday in the US Source: https://github.com/raphasampaio/holidays.jl/blob/main/docs/src/getting_started.md Demonstrates how to create a holiday calendar for the United States and check if specific dates are holidays. It uses the `Dates` module for date manipulation and the `in` operator for checking holiday status. ```julia using Holidays using Dates # Create a holiday calendar for a specific country usa_holidays = Holidays.UnitedStates() # Check if a specific date is a holiday @show Date(2024, 1, 1) in usa_holidays # New Year's Day - true @show Date(2024, 7, 4) in usa_holidays # Independence Day - true @show Date(2024, 12, 25) in usa_holidays # Christmas Day - true @show Date(2024, 3, 15) in usa_holidays # Random date - false ``` -------------------------------- ### Check US Holidays Source: https://github.com/raphasampaio/holidays.jl/blob/main/README.md Shows how to create a Holidays object for the United States and check if specific dates are holidays, such as New Year's Day, Memorial Day, and Thanksgiving Day. ```julia using Holidays using Dates holidays = Holidays.UnitedStates() # check if new year's day is a holiday @show Date(2024, 1, 1) in holidays # true # check if memorial day is a holiday @show Date(2024, 5, 27) in holidays # true # check if thanksgiving day is a holiday @show Date(2024, 11, 28) in holidays # true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.