Package: holidays
A fast, efficient Python library for generating country- and subdivision- (e.g.
state or province) specific sets of government-designated holidays on the fly.
It aims to make determining whether a specific date is a holiday as fast and
flexible as possible.PyPI:CI/CD:Code:GitHub:InstallThe latest stable version can always be installed or updated via pip:$pipinstall--upgradeholidaysThe latest development (beta) version can be installed directly from GitHub:$pipinstall--upgradehttps://github.com/vacanza/python-holidays/tarball/betaAll new features are always first pushed to beta branch, then released on
master branch upon official version upgrades.DocumentationThe documentation is hosted onRead the Docs.Quick Startfromdatetimeimportdateimportholidaysus_holidays=holidays.US()# this is a dict# the below is the same, but takes a string:us_holidays=holidays.country_holidays('US')# this is a dictnyse_holidays=holidays.NYSE()# this is a dict# the below is the same, but takes a string:nyse_holidays=holidays.financial_holidays('NYSE')# this is a dictdate(2015,1,1)inus_holidays# Truedate(2015,1,2)inus_holidays# Falseus_holidays.get('2014-01-01')# "New Year's Day"The HolidayBase dict-like class will also recognize date strings and Unix
timestamps:'2014-01-01'inus_holidays# True'1/1/2014'inus_holidays# True1388597445inus_holidays# TrueSome holidays may be only present in parts of a country:us_pr_holidays=holidays.country_holidays('US',subdiv='PR')'2018-01-06'inus_holidays# False'2018-01-06'inus_pr_holidays# TruePlease see thepython-holidays documentationfor additional examples and
detailed information.Available CountriesWe currently support 143 country codes. The standard way to refer to a country
is by using itsISO 3166-1 alpha-2 code, the same used for domain names, and
for a subdivision itsISO 3166-2 code. Some countries have common or foreign
names or abbreviations as aliases for their subdivisions. These are defined in
the (optional)subdivisions_aliasesattribute.
Some of the countries support more than one language for holiday names output.
A default language is defined bydefault_language(optional) attribute
for each entity and is used as a fallback when neither user specified
language nor user locale language available. The default language code is
aISO 639-1 code. A list of all languages supported by country is defined bysupported_languages(optional) attribute. If there is no designatedISO 639-1 codethenISO 639-2 codecan be used.Many countries have other categories of holidays in addition to common (national-wide) holidays:
bank holidays, school holidays, additional (paid or non-paid) holidays, holidays of state or
public employees, religious holidays (valid only for these religions followers). A list of all
categories supported by country is defined bysupported_categories(optional) attribute.The following is a list of supported countries, their subdivisions followed by their
aliases (if any) in brackets, available languages and additional holiday categories.
All countries supportPUBLICholidays category by default.
All other default values are highlighted with bold:CountryCodeSubdivisionsSupported LanguagesSupported CategoriesAlbaniaALAlgeriaDZar, en_US, frAmerican SamoaASCan also be loaded as country US, subdivision ASAndorraADParishes: 02, 03, 04, 05, 06, 07, 08AngolaAOen_US,pt_AO, ukArgentinaARen_US,es, ukArmeniaAMen_US,hyArubaAWen_US, nl,pap, ukAustraliaAUStates and territories:ACT, NSW, NT, QLD, SA, TAS, VIC, WAAustriaATStates: 1 (Burgenland, Bgld, B), 2 (Kärnten, Ktn, K), 3 (Niederösterreich, NÖ, N), 4 (Oberösterreich, OÖ, O), 5 (Salzburg, Sbg, S), 6 (Steiermark, Stmk, St), 7 (Tirol, T), 8 (Vorarlberg, Vbg, V), 9 (Wien, W)de, en_US, ukBANKAzerbaijanAZaz, en_US, ukWORKDAYBahamasBSBahrainBHar, en_USBangladeshBDBarbadosBBBelarusBYbe, en_USBelgiumBEde, en_US, fr,nl, ukBANKBelizeBZBoliviaBODepartments: B, C, H, L, N, O, P, S, Ten_US,es, ukBosnia and HerzegovinaBAEntities and district: BIH, BRC, SRPbs, en_US, sr, ukBotswanaBWBrazilBRStates: AC, AL, AM, AP, BA, CE, DF, ES, GO, MA, MG, MS, MT, PA, PB, PE, PI, PR, RJ, RN, RO, RR, RS, SC, SE, SP, TOOPTIONALBruneiBNen_US,ms, thBulgariaBGbg, en_US, ukSCHOOLBurkina FasoBFBurundiBICambodiaKHen_US,km, thCameroonCMCanadaCAProvinces and territories: AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YTar,en_CA, en_US, fr, thGOVERNMENT, OPTIONALChadTDChileCLRegions: AI, AN, AP, AR, AT, BI, CO, LI, LL, LR, MA, ML, NB, RM, TA, VSen_US,es, ukChinaCNen_US, th,zh_CN, zh_TWHALF_DAYColombiaCOen_US,es, ukCosta RicaCRen_US,es, ukOPTIONALCroatiaHRen_US,hr, ukCubaCUen_US,es, ukCuracaoCWen_US, nl,pap, ukCyprusCYel, en_CY, en_US, ukBANK, OPTIONALCzechiaCZcs, en_US, sk, ukDenmarkDKda, en_US, ukOPTIONALDjiboutiDJar, en_US,frDominican RepublicDOen_US,es, ukEcuadorECen_US,es, ukEgyptEGar, en_USEl SalvadorSVDepartments: AH, CA, CH, CU, LI, MO, PA, SA, SM, SO, SS, SV, UN, USEstoniaEEen_US,et, ukEswatiniSZEthiopiaETam, ar, en_USFinlandFIen_US,fi, sv, ukFranceFRDépartements: BL, GES, GP, GY, MF, MQ, NC, PF, RE, WF, YTen_US,fr, ukGabonGAGeorgiaGEen_US,ka, ukGermanyDEStates: BB, BE, BW, BY, BYP, HB, HE, HH, MV, NI, NW, RP, SH, SL, SN, ST, THde, en_US, ukGhanaGHGreeceGRel, en_US, ukHALF_DAYGuamGUCan also be loaded as country US, subdivision GUGuatemalaGTen_US,esHondurasHNen_US,es, ukHong KongHKHungaryHUen_US,hu, ukIcelandISen_US,is, ukIndiaINStates: AN, AP, AR, AS, BR, CG, CH, DD, DH, DL, GA, GJ, HP, HR, JH, JK, KA, KL, LA, LD, MH, ML, MN, MP, MZ, NL, OR, PB, PY, RJ, SK, TN, TR, TS, UK, UP, WBIndonesiaIDen_US,id, ukGOVERNMENTIranIRen_US,faIrelandIEIsle of ManIMIsraelILen_US,he, ukOPTIONAL, SCHOOLItalyITProvinces: AG, AL, AN, AO, AP, AQ, AR, AT, AV, BA, BG, BI, BL, BN, BO, BR, BS, BT, BZ, CA, CB, CE, CH, CL, CN, CO, CR, CS, CT, CZ, EN, FC, FE, FG, FI, FM, FR, GE, GO, GR, IM, IS, KR, LC, LE, LI, LO, LT, LU, MB, MC, ME, MI, MN, MO, MS, MT, NA, NO, NU, OR, PA, PC, PD, PE, PG, PI, PN, PO, PR, PT, PU, PV, PZ, RA, RC, RE, RG, RI, RM, RN, RO, SA, SI, SO, SP, SR, SS, SU, SV, TA, TE, TN, TO, TP, TR, TS, TV, UD, VA, VB, VC, VE, VI, VR, VT, VV. Cities: Andria, Barletta, Cesena, Forli, Pesaro, Trani, UrbinoJamaicaJMJapanJPen_US,ja, thBANKJerseyJEKazakhstanKZKenyaKEKyrgyzstanKGLaosLAen_US,lo, thBANK, SCHOOL, WORKDAYLatviaLVen_US,lv, ukLesothoLSLiechtensteinLIde, en_US, ukBANKLithuaniaLTen_US,lt, ukLuxembourgLUde, en_US, fr,lb, ukMadagascarMGen_US,mg, ukMalawiMWMalaysiaMYStates: JHR, KDH, KTN, KUL, LBN, MLK, NSN, PHG, PJY, PLS, PNG, PRK, SBH, SGR, SWK, TRGMaldivesMVMaltaMTen_US,mtMarshall Islands (the)MHMexicoMXen_US,es, ukMoldovaMDen_US,ro, ukMonacoMCen_US,fr, ukMontenegroMEMoroccoMAar, en_US, frMozambiqueMZen_US,pt_MZ, ukNamibiaNANetherlandsNLen_US,nl, ukOPTIONALNew ZealandNZRegions: AUK, BOP, CAN, CIT, GIS, HKB, MBH, MWT, NSN, NTL, OTA, STL, TAS, TKI, WGN, WKO, WTCNicaraguaNIDepartments: AN, AS, BO, CA, CI, CO, ES, GR, JI, LE, MD,MN, MS, MT, NS, RI, SJen_US,es, ukNigeriaNGNorthern Mariana Islands (the)MPCan also be loaded as country US, subdivision MPNorth MacedoniaMKNorwayNOen_US,no, ukPakistanPKPanamaPAPapua New GuineaPGParaguayPYen_US,es, ukGOVERNMENTPeruPEen_US,es, ukPhilippinesPHPolandPLen_US,pl, ukPortugalPTDistricts: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 30en_US,pt_PT, ukOPTIONALPuerto RicoPRCan also be loaded as country US, subdivision PRRomaniaROen_US,ro, ukRussiaRUen_US,ruSan MarinoSMSaudi ArabiaSAar, en_USSerbiaRSen_US,srSingaporeSGSlovakiaSKen_US,sk, ukWORKDAYSloveniaSIen_US,sl, ukSouth AfricaZASouth KoreaKRen_US,ko, thBANKSpainESAutonomous communities: AN, AR, AS, CB, CE, CL, CM, CN, CT, EX, GA, IB, MC, MD, ML, NC, PV, RI, VCen_US,es, ukSwedenSEen_US,sv, ukSwitzerlandCHCantons: AG, AI, AR, BL, BS, BE, FR, GE, GL, GR, JU, LU, NE, NW, OW, SG, SH, SZ, SO, TG, TI, UR, VD, VS, ZG, ZHde, en_US, fr, it, ukHALF_DAY, OPTIONALTaiwanTWen_US, th, zh_CN,zh_TWTanzaniaTZen_US,swBANKThailandTHen_US,thARMED_FORCES, BANK, GOVERNMENT, SCHOOL, WORKDAYTimor LesteTLen_US,pt_TL, tetGOVERNMENT, WORKDAYTongaTOen_US,toTunisiaTNar, en_USTurkeyTRen_US,tr, ukHALF_DAYUkraineUAar, en_US,ukUnited Arab EmiratesAEar, en_USUnited KingdomGBSubdivisions: ENG, NIR, SCT, WLSUnited States Minor Outlying IslandsUMCan also be loaded as country US, subdivision UMUnited States of America (the)USStates and territories: AK, AL, AR, AS, AZ, CA, CO, CT, DC, DE, FL, GA, GU, HI, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MP, MS, MT, NC, ND, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, PR, RI, SC, SD, TN, TX, UM, UT, VA, VI, VT, WA, WI, WV, WYUnited States Virgin Islands (the)See Virgin Islands (U.S.)UruguayUYen_US,es, ukBANKUzbekistanUZen_US, uk,uzVanuatuVUVatican CityVAVenezuelaVEen_US,es, ukVietnamVNVirgin Islands (U.S.)VICan also be loaded as country US, subdivision VIZambiaZMZimbabweZWAvailable Financial MarketsThe standard way to refer to a financial market is to use itsISO 10383 MIC(Market Identifier Code) as a “country” code when available. The
following financial markets are available:EntityCodeInfoEuropean Central BankECBTrans-European Automated Real-time Gross Settlement (TARGET2)New York Stock ExchangeXNYSNYSE market holidays (used by all other US-exchanges, including NASDAQ, etc.)ContributionsIssuesandpull requestsare always welcome.  Please seeherefor more information.LicenseCode and documentation are available according to the MIT License
(seeLICENSE).