Provinces and territories: AB, BC, MB, NB, NL, NS NT, NU, ON (default), PE, QC, SK, YU States: AC, AL, AM, AP, BA, CE, DF, ES, GO, MA, MG, MS, MT, PA, PB, PE, PI, RJ, RN, RO, RR, RS, SC, SE, SP, TO States and territories: ACT (default), NSW, NT, QLD, SA, TAS, VIC, WA Theįollowing countries and their subdivisions are available: Using its ISO 3166-1 alpha-2 code, the same used for domain names. The standard way to refer to a country is by Please see the documentation for additional examples and detailed country_holidays ( 'US', subdiv = 'PR' ) '' in us_holidays # False '' in us_pr_holidays # True Some holidays may be only present in parts of a country: us_pr_holidays = holidays. Timestamps: '' in us_holidays # True '' in us_holidays # True 1388597445 in us_holidays # True The HolidayBase dict-like class will also recognize date strings and Unix financial_holidays ( 'NYSE' ) # this is a dict date ( 2015, 1, 1 ) in us_holidays # True date ( 2015, 1, 2 ) in us_holidays # False us_holidays. NYSE () # this is a dict # the below is the same, but takes a string: nyse_holidays = holidays. country_holidays ( 'US' ) # this is a dict nyse_holidays = holidays. US () # this is a dict # the below is the same, but takes a string: us_holidays = holidays. Quick Start from datetime import date import holidays us_holidays = holidays. The documentation is hosted on Read the Docs. The latest stable version can always be installed or updated via pip: $ pip install -update holidays Documentation It aims to make determining whether a specific date is a holiday as fast andįlexible as possible. State or province) specific sets of government-designated holidays on the fly. A fast, efficient Python library for generating country- and subdivision- (e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |