Package: holiday-oracle
Holiday Oracle Python bindingsThe Holiday Oracle Python library provides convenient access to the global holiday API provided byOff Chain Datafrom applications written in the Python language.RequirementsAn API token fromHoliday OraclePython 3.4+InstallationInstall with pip:pip install --upgrade holiday-oracleInstall from source with:pip install --editable .Calling the APICalling the API is straight-forward:fromoffchain.apiimportHolidayOracleApiapi=HolidayOracleApi(token)resp=api.me()print(resp.json)If no token is provided, the library will look for aOCD_TOKENenvironment variable.The HTTP response code, headers and raw response data are also provided in the response object.Some API endpoints have mandatory parameters e.g.resp=api.date(country="AU",date="2020-01-01")Optional parameters can also be provided in the same way e.g.resp=api.date(country="AU",date="2020-01-01",subdivision="NSW")Handling errorsIf an error occurs, anApiErrorexception will be thrown e.g.try:resp=api.me()exceptApiErrorasex:print("ERROR:",ex.message)Supported LocationsThe following is a list of locations supported by the API.
Where a country has no subdivisions, holidays are returned for the entire country.
Where subdivisions are defined, you can query for holidays a both the country and subdivisions level.You can also query the APIhttps://offchaindata.com/docs/index.html#locationsfor a list of currently supported locations.CountrySubdivisionAndorra (AD)Andorra la Vella (07)United Arab Emirates (AE)Entire CountryAntigua and Barbuda (AG)Barbuda (10)Anguilla (AI)Entire CountryAlbania (AL)Entire CountryArmenia (AM)Entire CountryAngola (AO)Entire CountryArgentina (AR)Entire CountryAmerican Samoa (AS)Entire CountryAustria (AT)Burgenland (1),  Kärnten (2),  Niederösterreich (3),  Oberösterreich (4),  Salzburg (5),  Steiermark (6),  Tirol (7),  Vorarlberg (8),  Wien (9)Australia (AU)Australian Capital Territory (ACT),  New South Wales (NSW),  Northern Territory (NT),  Queensland (QLD),  South Australia (SA),  Tasmania (TAS),  Victoria (VIC),  Western Australia (WA)Aruba (AW)Entire CountryÅland Islands (AX)Entire CountryAzerbaijan (AZ)Entire CountryBosnia and Herzegovina (BA)Federacija Bosne i Hercegovine (BIH),  Brčko distrikt (BRC),  Republika Srpska (SRP)Barbados (BB)Entire CountryBangladesh (BD)Entire CountryBelgium (BE)Brussels Hoofdstedelijk Gewest (BRU),  Vlaams Gewest (VLG),  wallonne, Région (WAL)Burkina Faso (BF)Entire CountryBulgaria (BG)Entire CountryBahrain (BH)Entire CountryBurundi (BI)Entire CountryBenin (BJ)Entire CountrySaint Barthélemy (BL)Entire CountryBermuda (BM)Entire CountryBrunei Darussalam (BN)Entire CountryBolivia (Plurinational State of) (BO)Entire CountryBonaire, Sint Eustatius and Saba (BQ)Boneiru (BO),  Saba (SA),  Sint Eustatius (SE)Brazil (BR)Acre (AC),  Alagoas (AL),  Amazonas (AM),  Amapá (AP),  Bahia (BA),  Ceará (CE),  Distrito Federal (DF),  Espírito Santo (ES),  Goiás (GO),  Maranhão (MA),  Minas Gerais (MG),  Mato Grosso do Sul (MS),  Mato Grosso (MT),  Pará (PA),  Paraíba (PB),  Pernambuco (PE),  Piauí (PI),  Paraná (PR),  Rio de Janeiro (RJ),  Rio Grande do Norte (RN),  Rondônia (RO),  Roraima (RR),  Rio Grande do Sul (RS),  Santa Catarina (SC),  Sergipe (SE),  São Paulo (SP),  Tocantins (TO)Bahamas (BS)Entire CountryBotswana (BW)Entire CountryBelarus (BY)Entire CountryBelize (BZ)Entire CountryCanada (CA)Alberta (AB),  Colombie-Britannique (BC),  Manitoba (MB),  Nouveau-Brunswick (NB),  Terre-Neuve-et-Labrador (NL),  Nouvelle-Écosse (NS),  Territoires du Nord-Ouest (NT),  Nunavut (NU),  Ontario (ON),  Île-du-Prince-Édouard (PE),  Québec (QC),  Saskatchewan (SK),  Yukon (YT)Cocos (Keeling) Islands (CC)Entire CountryCongo, Democratic Republic of the (CD)Entire CountryCentral African Republic (CF)Entire CountryCongo (CG)Entire CountrySwitzerland (CH)Aargau (AG),  Appenzell Innerrhoden (AI),  Appenzell Ausserrhoden (AR),  Berne (BE),  Basel-Landschaft (BL),  Basel-Stadt (BS),  Fribourg (FR),  Genève (GE),  Glarus (GL),  Grischun (GR),  Jura (JU),  Luzern (LU),  Neuchâtel (NE),  Nidwalden (NW),  Obwalden (OW),  Sankt Gallen (SG),  Schaffhausen (SH),  Solothurn (SO),  Schwyz (SZ),  Thurgau (TG),  Ticino (TI),  Uri (UR),  Vaud (VD),  Valais (VS),  Zug (ZG),  Zürich (ZH)Côte d'Ivoire (CI)Entire CountryChile (CL)Arica y Parinacota (AP),  Atacama (AT),  Biobío (BI),  Coquimbo (CO),  Los Ríos (LR),  Magallanes (MA),  Tarapacá (TA)Cameroon (CM)Entire CountryChina (CN)Entire CountryColombia (CO)Entire CountryCosta Rica (CR)Entire CountryCuba (CU)Entire CountryCabo Verde (CV)Ilhas de Sotavento (S)Curaçao (CW)Entire CountryChristmas Island (CX)Entire CountryCyprus (CY)Entire CountryCzechia (CZ)Entire CountryGermany (DE)Brandenburg (BB),  Berlin (BE),  Baden-Württemberg (BW),  Bayern (BY),  Bremen (HB),  Hessen (HE),  Hamburg (HH),  Mecklenburg-Vorpommern (MV),  Niedersachsen (NI),  Nordrhein-Westfalen (NW),  Rheinland-Pfalz (RP),  Schleswig-Holstein (SH),  Saarland (SL),  Sachsen (SN),  Sachsen-Anhalt (ST),  Thüringen (TH)Denmark (DK)Entire CountryDominica (DM)Entire CountryDominican Republic (DO)Entire CountryAlgeria (DZ)Entire CountryEcuador (EC)Pichincha (P)Estonia (EE)Entire CountryEgypt (EG)Entire CountrySpain (ES)Andalucía (AN),  Aragón (AR),  Asturias, Principado de (AS),  Cantabria (CB),  Ceuta (CE),  Castilla y León (CL),  Castilla-La Mancha (CM),  Canarias (CN),  Catalunya (CT),  Extremadura (EX),  Galicia (GA),  Illes Balears (IB),  La Rioja (LO),  Madrid (M),  Murcia, Región de (MC),  Madrid, Comunidad de (MD),  Melilla (ML),  Murcia (MU),  Navarra (NA),  Navarra, Comunidad Foral de (NC),  Asturias (O),  País Vasco (PV),  La Rioja (RI),  Valenciana, Comunidad (VC)Ethiopia (ET)Entire CountryFinland (FI)Entire CountryMicronesia (Federated States of) (FM)Entire CountryFaroe Islands (FO)Entire CountryFrance (FR)Moselle (57),  Bas-Rhin (67),  Haut-Rhin (68),  Saint-Barthélemy (BL),  Guyane (GF),  Guadeloupe (GP),  Guadeloupe (GUA),  La Réunion (LRE),  Mayotte (MAY),  Saint-Martin (MF),  Martinique (MQ),  Nouvelle-Calédonie (NC),  Polynésie française (PF),  La Réunion (RE),  Wallis-et-Futuna (WF),  Mayotte (YT)Gabon (GA)Entire CountryUnited Kingdom of Great Britain and Northern Ireland (GB)England (ENG),  Northern Ireland (NIR),  Scotland (SCT),  Wales (WLS)Grenada (GD)Entire CountryFrench Guiana (GF)Entire CountryGuernsey (GG)Entire CountryGibraltar (GI)Entire CountryGreenland (GL)Entire CountryGambia (GM)Entire CountryGuadeloupe (GP)Entire CountryEquatorial Guinea (GQ)Entire CountryGreece (GR)Entire CountryGuatemala (GT)Entire CountryGuam (GU)Entire CountryGuyana (GY)Entire CountryHong Kong (HK)Entire CountryHonduras (HN)Entire CountryCroatia (HR)Splitsko-dalmatinska županija (17),  Dubrovačko-neretvanska županija (19)Haiti (HT)Entire CountryHungary (HU)Entire CountryIndonesia (ID)Entire CountryIreland (IE)Entire CountryIsrael (IL)Entire CountryIsle of Man (IM)Entire CountryIndia (IN)Andhra Pradesh (AP),  Assam (AS),  Bihar (BR),  Gujarat (GJ),  Haryana (HR),  Karnataka (KA),  Kerala (KL),  Maharashtra (MH),  Madhya Pradesh (MP),  Rajasthan (RJ),  Sikkim (SK),  Tamil Nadu (TN),  Uttar Pradesh (UP),  West Bengal (WB)Iceland (IS)Entire CountryItaly (IT)Valle d'Aosta (23),  Trentino-Alto Adige (32),  Ancona (AN),  Bari (BA),  Belluno (BL),  Bologna (BO),  Brescia (BS),  Bolzano (BZ),  Campobasso (CB),  Chieti (CH),  Cosenza (CS),  Catania (CT),  Enna (EN),  Forlì-Cesena (FC),  Ferrara (FE),  Firenze (FI),  Frosinone (FR),  Genova (GE),  Isernia (IS),  Crotone (KR),  Latina (LT),  Monza e Brianza (MB),  Milano (MI),  Mantova (MN),  Modena (MO),  Massa-Carrara (MS),  Napoli (NA),  Palermo (PA),  Piacenza (PC),  Padova (PD),  Pescara (PE),  Perugia (PG),  Pisa (PI),  Parma (PR),  Pistoia (PT),  Pesaro e Urbino (PU),  Ravenna (RA),  Reggio Emilia (RE),  Rieti (RI),  Roma (RM),  Rimini (RN),  Rovigo (RO),  Salerno (SA),  La Spezia (SP),  Siracusa (SR),  Teramo (TE),  Torino (TO),  Vercelli (VC),  Venezia (VE),  Vicenza (VI)Jersey (JE)Entire CountryJamaica (JM)Entire CountryJapan (JP)Entire CountryKenya (KE)Entire CountryKorea, Republic of (KR)Entire CountryCayman Islands (KY)Entire CountryLiechtenstein (LI)Entire CountryLesotho (LS)Entire CountryLithuania (LT)Entire CountryLuxembourg (LU)Entire CountryLatvia (LV)Entire CountryMorocco (MA)Entire CountryMonaco (MC)Entire CountryMoldova, Republic of (MD)Cahul (CA),  Chișinău (CU)Montenegro (ME)Entire CountryMadagascar (MG)Entire CountryMarshall Islands (MH)Entire CountryNorth Macedonia (MK)Entire CountryMongolia (MN)Entire CountryNorthern Mariana Islands (MP)Entire CountryMartinique (MQ)Entire CountryMalta (MT)Entire CountryMalawi (MW)Entire CountryMexico (MX)Entire CountryMalaysia (MY)Entire CountryMozambique (MZ)Entire CountryNamibia (NA)Entire CountryNiger (NE)Entire CountryNicaragua (NI)Entire CountryNetherlands (NL)Entire CountryNorway (NO)Entire CountryNew Zealand (NZ)Tāmaki-makau-rau (AUK),  Te Moana a Toi Te Huatahi (BOP),  Waitaha (CAN),  Wharekauri (CIT),  Tūranga nui a Kiwa (GIS),  Te Matau a Māui (HKB),  Marlborough (MBH),  Manawatu Whanganui (MWT),  Whakatū (NSN),  Te Tai tokerau (NTL),  Ō Tākou (OTA),  Murihiku (STL),  Tasman (TAS),  Taranaki (TKI),  Te Whanga-nui-a-Tara (WGN),  Waikato (WKO),  Te Taihau ā uru (WTC)Panama (PA)Entire CountryPeru (PE)Cusco (CUS)Philippines (PH)Entire CountryPoland (PL)Entire CountryPuerto Rico (PR)Entire CountryPortugal (PT)Região Autónoma dos Açores (20),  Região Autónoma da Madeira (30)Palau (PW)Entire CountryParaguay (PY)Entire CountryQatar (QA)Entire CountryRéunion (RE)Entire CountryRomania (RO)Entire CountrySerbia (RS)Entire CountryRussian Federation (RU)Entire CountryRwanda (RW)Entire CountrySweden (SE)Entire CountrySingapore (SG)Entire CountrySaint Helena, Ascension and Tristan da Cunha (SH)Ascension (AC),  Saint Helena (HL),  Tristan da Cunha (TA)Slovenia (SI)Entire CountrySvalbard and Jan Mayen (SJ)Entire CountrySlovakia (SK)Banskobystrický kraj (BC),  Bratislavský kraj (BL),  Košický kraj (KI),  Nitriansky kraj (NI),  Prešovský kraj (PV),  Trnavský kraj (TA),  Trenčiansky kraj (TC),  Žilinský kraj (ZI)San Marino (SM)Entire CountrySomalia (SO)Awdal (AW),  Sanaag (SA),  Sool (SO),  Togdheer (TO),  Woqooyi Galbeed (WO)Suriname (SR)Entire CountrySouth Sudan (SS)Entire CountrySao Tome and Principe (ST)Entire CountryEl Salvador (SV)San Salvador (SS)Togo (TG)Entire CountryTunisia (TN)Entire CountryTonga (TO)Entire CountryTurkey (TR)Entire CountryTaiwan, Province of China (TW)Entire CountryTanzania, United Republic of (TZ)Entire CountryUkraine (UA)Entire CountryUganda (UG)Entire CountryUnited States of America (US)Alaska (AK),  Alabama (AL),  Arkansas (AR),  American Samoa (AS),  Arizona (AZ),  California (CA),  Colorado (CO),  Connecticut (CT),  District of Columbia (DC),  Delaware (DE),  Florida (FL),  Georgia (GA),  Guam (GU),  Hawaii (HI),  Iowa (IA),  Idaho (ID),  Illinois (IL),  Indiana (IN),  Kansas (KS),  Kentucky (KY),  Louisiana (LA),  Massachusetts (MA),  Maryland (MD),  Maine (ME),  Michigan (MI),  Minnesota (MN),  Missouri (MO),  Northern Mariana Islands (MP),  Mississippi (MS),  Montana (MT),  North Carolina (NC),  North Dakota (ND),  Nebraska (NE),  New Hampshire (NH),  New Jersey (NJ),  New Mexico (NM),  Nevada (NV),  New York (NY),  Ohio (OH),  Oklahoma (OK),  Oregon (OR),  Pennsylvania (PA),  Puerto Rico (PR),  Rhode Island (RI),  South Carolina (SC),  South Dakota (SD),  Tennessee (TN),  Texas (TX),  Utah (UT),  Virginia (VA),  Virgin Islands, U.S. (VI),  Vermont (VT),  Washington (WA),  Wisconsin (WI),  West Virginia (WV),  Wyoming (WY)Uruguay (UY)Entire CountryHoly See (VA)Entire CountryVenezuela (Bolivarian Republic of) (VE)Anzoátegui (B),  Carabobo (G),  Lara (K),  Miranda (M),  Monagas (N),  Táchira (S),  Zulia (V)Virgin Islands (U.S.) (VI)Entire CountryViet Nam (VN)Entire CountryMayotte (YT)Entire CountrySouth Africa (ZA)Entire CountryZambia (ZM)Entire CountryZimbabwe (ZW)Entire Country