@@ -33,20 +33,32 @@ Example Usage
3333 date(2015 , 1 , 1 ) in us_holidays # True
3434 date(2015 , 1 , 2 ) in us_holidays # False
3535
36-
36+ # The Holiday class will also recognize strings of any format
37+ # and int/float representing a Unix timestamp
3738 ' 2014-01-01' in us_holidays # True
38- ' 1/1/2014' in us_holidays # True
39- 1388597445 in us_holidays # True (Unix timestamp)
39+ ' 1/1/2014' in us_holidays # True
40+ 1388597445 in us_holidays # True
4041
4142 us_holidays.get(' 2014-01-01' ) # "New Year's Day"
4243
44+ # Easily create custom Holiday objects with your own dates instead
45+ # of using the pre-defined countries/states/provinces available
4346 custom_holidays = holidays.HolidayBase()
47+ # Append custom holiday dates by passing:
48+ # 1) a dict with date/name key/value pairs,
4449 custom_holidays.append({" 2015-01-01" : " New Year's Day" })
50+ # 2) a list of dates (in any format: date, datetime, string, integer),
4551 custom_holidays.append([' 2015-07-01' , ' 07/04/2015' ])
52+ # 3) a single date item
4653 custom_holidays.append(date(2015 , 12 , 25 ))
54+
4755 date(2015 , 1 , 1 ) in custom_holidays # True
4856 date(2015 , 1 , 2 ) in custom_holidays # False
49- ' 12/25/2015' in custom_holidays # True
57+ ' 12/25/2015' in custom_holidays # True
58+
59+ # For more complex logic like 4th Monday of January, you can inherit the
60+ # HolidayBase class and define your own _populate(year) method. See below
61+ # documentation for examples.
5062
5163
5264 Install
0 commit comments