Package: cnlunar
import datetimeimport cnlunar# a = cnlunar.Lunar() # 为空为当前时间a = cnlunar.Lunar(datetime.datetime(2022, 11, 14, 10, 30), godType=’8char’)  # 常规算法
# a = cnlunar.Lunar(datetime.datetime(2022, 2, 3, 10, 30), godType=’8char’, year8Char=’beginningOfSpring’)  # 八字立春切换算法‘日期’: a.date,‘农历数字’: (a.lunarYear, a.lunarMonth, a.lunarDay, ‘闰’ if a.isLunarLeapMonth else ‘’),‘农历’: ‘%s %s[%s]年 %s%s’ % (a.lunarYearCn, a.year8Char, a.chineseYearZodiac, a.lunarMonthCn, a.lunarDayCn),‘星期’: a.weekDayCn,# 未增加除夕‘今日节日’: (a.get_legalHolidays(), a.get_otherHolidays(), a.get_otherLunarHolidays()),‘八字’: ‘ ‘.join([a.year8Char, a.month8Char, a.day8Char, a.twohour8Char]),‘今日节气’: a.todaySolarTerms,‘下一节气’: (a.nextSolarTerm, a.nextSolarTermDate, a.nextSolarTermYear),‘今年节气表’: a.thisYearSolarTermsDic,‘季节’: a.lunarSeason,‘今日时辰’: a.twohour8CharList,‘时辰凶吉’: a.get_twohourLuckyList(),‘生肖冲煞’: a.chineseZodiacClash,‘星座’: a.starZodiac,‘星次’: a.todayEastZodiac,‘彭祖百忌’: a.get_pengTaboo(),‘彭祖百忌精简’: a.get_pengTaboo(long=4, delimit=’<br>’),‘十二神’: a.get_today12DayOfficer(),‘廿八宿’: a.get_the28Stars(),‘今日三合’: a.zodiacMark3List,‘今日六合’: a.zodiacMark6,‘今日五行’: a.get_today5Elements(),‘纳音’: a.get_nayin(),‘九宫飞星’: a.get_the9FlyStar(),‘吉神方位’: a.get_luckyGodsDirection(),‘今日胎神’: a.get_fetalGod(),‘神煞宜忌’: a.angelDemon,‘今日吉神’: a.goodGodName,‘今日凶煞’: a.badGodName,‘宜’: a.goodThing,‘忌’: a.badThing,‘时辰经络’: a.meridians八字月柱与八字日柱算神煞版本日期      :        2021-02-07 10:30:00农历数字 :   (2020, 12, 26, ‘’)农历      :        二零二零 庚子[鼠]年 腊月大廿六星期      :        星期日今日节日 :   (‘’, ‘京汉铁路罢工纪念’, ‘’)八字      :        庚子 庚寅 丙戌 癸巳今日节气 :   无下一节气 :   (‘雨水’, (2, 18), 2021)今年节气表 :  {‘小寒’: (1, 5), ‘大寒’: (1, 20), ‘立春’: (2, 3), ‘雨水’: (2, 18), ‘惊蛰’: (3, 5), ‘春分’: (3, 20), ‘清明’: (4, 4), ‘谷雨’: (4, 20), ‘立夏’: (5, 5), ‘小满’: (5, 21), ‘芒种’: (6, 5), ‘夏至’: (6, 21), ‘小暑’: (7, 7), ‘大暑’: (7, 22), ‘立秋’: (8, 7), ‘处暑’: (8, 23), ‘白露’: (9, 7), ‘秋分’: (9, 23), ‘寒露’: (10, 8), ‘霜降’: (10, 23), ‘立冬’: (11, 7), ‘小雪’: (11, 22), ‘大雪’: (12, 7), ‘冬至’: (12, 21)}季节      :        孟春今日时辰 :   [‘戊子’, ‘己丑’, ‘庚寅’, ‘辛卯’, ‘壬辰’, ‘癸巳’, ‘甲午’, ‘乙未’, ‘丙申’, ‘丁酉’, ‘戊戌’, ‘己亥’, ‘庚子’]时辰凶吉 :   [‘凶’, ‘凶’, ‘吉’, ‘凶’, ‘吉’, ‘吉’, ‘凶’, ‘凶’, ‘吉’, ‘吉’, ‘凶’, ‘吉’, ‘凶’]生肖冲煞 :   狗日冲龙星座      :        水瓶座星次      :        娵訾彭祖百忌 :   丙不修灶 必见灾殃,戌不吃犬 作怪上床彭祖百忌精简 :         丙不修灶<br>戌不吃犬十二神     :        (‘成’, ‘司命’, ‘黄道日’)廿八宿     :        星日马今日三合 :   [‘虎’, ‘马’]今日六合 :   兔今日五行 :   [‘天干’, ‘丙’, ‘属火’, ‘地支’, ‘戌’, ‘属土’, ‘纳音’, ‘土’, ‘属土’, ‘廿八宿’, ‘星’, ‘宿’, ‘十二神’, ‘成’, ‘日’]纳音      :        屋上土九宫飞星 :   279135684吉神方位 :   [‘喜神西南’, ‘财神西南’, ‘福神西北’, ‘阳贵正西’, ‘阴贵西北’]今日胎神 :   厨灶栖外西北神煞宜忌 :   (([‘月德’, ‘三合’, ‘四相’, ‘天喜’, ‘月恩’, ‘天官’], [‘月厌’, ‘神号’, ‘伏兵’, ‘地火’, ‘受死’, ‘飞廉’, ‘大煞’, ‘四击’, ‘宝日’]), ([‘祭祀’, ‘出行’, ‘结婚姻’, ‘宴会’, ‘嫁娶’, ‘修造’, ‘求医疗病’, ‘上表章’, ‘上官’, ‘入学’, ‘进人口’, ‘竖柱上梁’, ‘经络’, ‘开市’, ‘纳财’, ‘安碓硙’, ‘栽种’, ‘牧养’, ‘安葬’, ‘选将’, ‘求嗣’, ‘酝酿’, ‘临政’, ‘庆赐’, ‘安抚边境’, ‘解除’, ‘筑堤防’, ‘祈福’, ‘出师’, ‘纳采’, ‘纳畜’, ‘营建’, ‘立券交易’, ‘缮城郭’, ‘修宫室’, ‘恤孤茕’, ‘覃恩’, ‘裁制’, ‘开仓’, ‘修仓库’, ‘上册’, ‘雪冤’, ‘搬移’], [‘剃头’, ‘冠带’, ‘修置产室’, ‘开渠’, ‘穿井’, ‘平治道涂’, ‘破屋坏垣’, ‘伐木’, ‘畋猎’, ‘破土’, ‘启攒’, ‘布政事’, ‘修饰垣墙’, ‘整手足甲’, ‘远回’, ‘整容’, ‘补垣’, ‘取鱼’, ‘鼓铸’, ‘塞穴’]))今日吉神 :   [‘月德’, ‘三合’, ‘四相’, ‘天喜’, ‘月恩’, ‘天官’]今日凶煞 :   [‘月厌’, ‘神号’, ‘伏兵’, ‘地火’, ‘受死’, ‘飞廉’, ‘大煞’, ‘四击’, ‘宝日’]宜忌等第 :   中：吉不抵凶，遇德从宜不从忌，不遇从忌不从宜。宜               :        [‘祭祀’, ‘出行’, ‘结婚姻’, ‘宴会’, ‘嫁娶’, ‘修造’, ‘求医疗病’, ‘上表章’, ‘上官’, ‘入学’, ‘进人口’, ‘竖柱上梁’, ‘经络’, ‘开市’, ‘纳财’, ‘安碓硙’, ‘栽种’, ‘牧养’, ‘安葬’, ‘选将’, ‘求嗣’, ‘酝酿’, ‘临政’, ‘庆赐’, ‘安抚边境’, ‘解除’, ‘筑堤防’, ‘祈福’, ‘出师’, ‘纳采’, ‘纳畜’, ‘营建’, ‘立券交易’, ‘缮城郭’, ‘修宫室’, ‘恤孤茕’, ‘覃恩’, ‘裁制’, ‘开仓’, ‘修仓库’, ‘上册’, ‘雪冤’, ‘搬移’]忌               :        [‘剃头’, ‘冠带’, ‘修置产室’, ‘开渠’, ‘穿井’, ‘平治道涂’, ‘破屋坏垣’, ‘伐木’, ‘畋猎’, ‘破土’, ‘启攒’, ‘布政事’, ‘修饰垣墙’, ‘整手足甲’, ‘远回’, ‘整容’, ‘补垣’, ‘取鱼’, ‘鼓铸’, ‘塞穴’]时辰经络 :   脾