holidays.countries.china

Classes

CHN(*args, **kwargs)

param years:

CN(*args, **kwargs)

param years:

China(*args, **kwargs)

References:

ChinaStaticHolidays()

class holidays.countries.china.China(*args, **kwargs)

Bases: ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays, StaticHolidays

References:
Checked With:
Limitations:
  • Only checked with the official General Office of the State Council Notice from 2001 onwards.

  • Due to its complexity, need yearly checks 3-weeks before year’s end each year.

Parameters:
  • years – The year(s) to pre-calculate public holidays for at instantiation.

  • expand – Whether the entire year is calculated when one date from that year is requested.

  • observed – Whether to include the dates when public holiday are observed (e.g. a holiday falling on a Sunday being observed the following Monday). This doesn’t work for all countries.

  • subdiv – The subdivision (e.g. state or province) as a ISO 3166-2 code or its alias; not implemented for all countries (see documentation).

  • provdeprecated use subdiv instead.

  • statedeprecated use subdiv instead.

  • language – The language which the returned holiday names will be translated into. It must be an ISO 639-1 (2-letter) language code. If the language translation is not supported the original holiday names will be used.

  • categories – Requested holiday categories.

Returns:

A HolidayBase object matching the country.

country: str = 'CN'

The country’s ISO 3166-1 alpha-2 code.

observed_label = '%s(观察日)'
supported_categories: Tuple[str, ...] = ('public', 'half_day')

All holiday categories supported by this entity.

default_language: str | None = 'zh_CN'

The entity language used by default.

supported_languages: Tuple[str, ...] = ('en_US', 'th', 'zh_CN', 'zh_TW')

All languages supported by this entity.

class holidays.countries.china.CN(*args, **kwargs)

Bases: China

Parameters:
  • years – The year(s) to pre-calculate public holidays for at instantiation.

  • expand – Whether the entire year is calculated when one date from that year is requested.

  • observed – Whether to include the dates when public holiday are observed (e.g. a holiday falling on a Sunday being observed the following Monday). This doesn’t work for all countries.

  • subdiv – The subdivision (e.g. state or province) as a ISO 3166-2 code or its alias; not implemented for all countries (see documentation).

  • provdeprecated use subdiv instead.

  • statedeprecated use subdiv instead.

  • language – The language which the returned holiday names will be translated into. It must be an ISO 639-1 (2-letter) language code. If the language translation is not supported the original holiday names will be used.

  • categories – Requested holiday categories.

Returns:

A HolidayBase object matching the country.

class holidays.countries.china.CHN(*args, **kwargs)

Bases: China

Parameters:
  • years – The year(s) to pre-calculate public holidays for at instantiation.

  • expand – Whether the entire year is calculated when one date from that year is requested.

  • observed – Whether to include the dates when public holiday are observed (e.g. a holiday falling on a Sunday being observed the following Monday). This doesn’t work for all countries.

  • subdiv – The subdivision (e.g. state or province) as a ISO 3166-2 code or its alias; not implemented for all countries (see documentation).

  • provdeprecated use subdiv instead.

  • statedeprecated use subdiv instead.

  • language – The language which the returned holiday names will be translated into. It must be an ISO 639-1 (2-letter) language code. If the language translation is not supported the original holiday names will be used.

  • categories – Requested holiday categories.

Returns:

A HolidayBase object matching the country.

class holidays.countries.china.ChinaStaticHolidays

Bases: object

substituted_date_format = '%Y-%m-%d'
substituted_label = '休息日(%s日起取代)'
chinese_new_year = '春节'
chinese_new_year_extended = '春节延长假期'
dragon_boat_festival = '端午节'
mid_autumn_festival = '中秋节'
victory_70_anniversary = '中国人民抗日战争暨世界反法西斯战争胜利70周年纪念日'
special_public_holidays = {2001: ((1, 29, 1, 20), (1, 30, 1, 21), (5, 4, 4, 28), (5, 7, 4, 29), (10, 4, 9, 29), (10, 5, 9, 30)), 2002: ((1, 2, 12, 29, 2001), (1, 3, 12, 30, 2001), (2, 15, 2, 9), (2, 18, 2, 10), (5, 6, 4, 27), (5, 7, 4, 28), (10, 4, 9, 28), (10, 7, 9, 29)), 2003: ((2, 6, 2, 8), (2, 7, 2, 9), (5, 6, 4, 26), (5, 7, 4, 27), (10, 6, 9, 27), (10, 7, 9, 28)), 2004: ((1, 27, 1, 17), (1, 28, 1, 18), (5, 6, 5, 8), (5, 7, 5, 9), (10, 6, 10, 9), (10, 7, 10, 10)), 2005: ((2, 14, 2, 5), (2, 15, 2, 6), (5, 5, 4, 30), (5, 6, 5, 8), (10, 6, 10, 8), (10, 7, 10, 9)), 2006: ((1, 3, 12, 31, 2005), (2, 2, 1, 28), (2, 3, 2, 5), (5, 4, 4, 29), (5, 5, 4, 30), (10, 5, 9, 30), (10, 6, 10, 8)), 2007: ((1, 2, 12, 30, 2006), (1, 3, 12, 31, 2006), (2, 22, 2, 17), (2, 23, 2, 25), (5, 4, 4, 28), (5, 7, 4, 29), (10, 4, 9, 29), (10, 5, 9, 30), (12, 31, 12, 29)), 2008: ((2, 11, 2, 2), (2, 12, 2, 3), (5, 2, 5, 4), (9, 29, 9, 27), (9, 30, 9, 28)), 2009: ((1, 2, 1, 4), (1, 29, 1, 24), (1, 30, 2, 1), (5, 29, 5, 31), (10, 7, 9, 27), (10, 8, 10, 10)), 2010: ((2, 18, 2, 20), (2, 19, 2, 21), (6, 14, 6, 12), (6, 15, 6, 13), (9, 23, 9, 19), (9, 24, 9, 25), (10, 6, 9, 26), (10, 7, 10, 9)), 2011: ((2, 7, 1, 30), (2, 8, 2, 12), (4, 4, 4, 2), (10, 6, 10, 8), (10, 7, 10, 9)), 2012: ((1, 3, 12, 31, 2011), (1, 26, 1, 21), (1, 27, 1, 29), (4, 2, 3, 31), (4, 3, 4, 1), (4, 30, 4, 28), (10, 5, 9, 29)), 2013: ((1, 2, 1, 5), (1, 3, 1, 6), (2, 14, 2, 16), (2, 15, 2, 17), (4, 5, 4, 7), (4, 29, 4, 27), (4, 30, 4, 28), (6, 10, 6, 8), (6, 11, 6, 9), (9, 20, 9, 22), (10, 4, 9, 29), (10, 7, 10, 12)), 2014: ((2, 5, 1, 26), (2, 6, 2, 8), (5, 2, 5, 4), (10, 6, 9, 28), (10, 7, 10, 11)), 2015: ((1, 2, 1, 4), (2, 18, 2, 15), (2, 24, 2, 28), (9, 3, '中国人民抗日战争暨世界反法西斯战争胜利70周年纪念日'), (9, 4, 9, 6), (10, 7, 10, 10)), 2016: ((2, 11, 2, 6), (2, 12, 2, 14), (6, 10, 6, 12), (9, 16, 9, 18), (10, 6, 10, 8), (10, 7, 10, 9)), 2017: ((1, 27, 1, 22), (2, 2, 2, 4), (4, 3, 4, 1), (5, 29, 5, 27), (10, 6, 9, 30)), 2018: ((2, 15, 2, 11), (2, 21, 2, 24), (4, 6, 4, 8), (4, 30, 4, 28), (10, 4, 9, 29), (10, 5, 9, 30), (12, 31, 12, 29)), 2019: ((2, 4, 2, 2), (2, 8, 2, 3), (10, 4, 9, 29), (10, 7, 10, 12)), 2020: ((1, 24, 1, 19), (1, 31, '春节延长假期'), (2, 1, '春节延长假期'), (2, 2, '春节延长假期'), (5, 4, 4, 26), (5, 5, 5, 9), (6, 26, 6, 28), (10, 7, 9, 27), (10, 8, 10, 10)), 2021: ((2, 11, 2, 7), (2, 17, 2, 20), (5, 4, 4, 25), (5, 5, 5, 8), (9, 20, 9, 18), (10, 6, 9, 26), (10, 7, 10, 9)), 2022: ((1, 31, 1, 29), (2, 4, 1, 30), (4, 4, 4, 2), (5, 3, 4, 24), (5, 4, 5, 7), (10, 6, 10, 8), (10, 7, 10, 9)), 2023: ((1, 26, 1, 28), (1, 27, 1, 29), (5, 2, 4, 23), (5, 3, 5, 6), (6, 23, 6, 25), (10, 5, 10, 7), (10, 6, 10, 8)), 2024: ((2, 15, 2, 4), (2, 16, 2, 18), (4, 5, 4, 7), (5, 2, 4, 28), (5, 3, 5, 11), (9, 16, 9, 14), (10, 4, 9, 29), (10, 7, 10, 12))}
special_public_holidays_observed = {2012: (6, 22, '端午节'), 2015: (10, 6, '中秋节'), 2020: ((1, 30, '春节'), (10, 6, '中秋节'))}