import datetimefrom chinese_calendar import is_workday, is_holiday,get_holiday_detail,is_in_lieu
date = datetime.date(2022, 1, 1) # 2022-01-01 Friday New year's Day IsWorkday = is_workday(date) # Is it a weekday IsHoliday = is_holiday(date) # Whether it's a holiday or not OnHoliday, HolidayName = get_holiday_detail(date) # Whether it's a holiday or not 、 Holiday Name IsInlieu = is_in_lieu(date) # Compensatory leave or not ( To be verified )print(" Is it a weekday :",IsWorkday)print(" Whether it's a holiday or not :",IsHoliday)print(" Whether it's a holiday or not :",OnHoliday," || Holiday Name :",HolidayName)print(" Compensatory leave or not :",IsInlieu)
Reference resources :https://pypi.org/project/chinesecalendar/
author :small__roc
this paper [ python chinese_calendar Working day 、 Holiday day 、 Off day judgment ] Included in Game programming ️ - Python, A game development favorite ~
If the picture is not displayed for a long time , Please use Chrome browser .