Skip to main content

Information about Chinese perpetual calendar

Project description

内容列表

简介

Chinese permanent calendar

这是一个通过python查询中国万年历相关信息的的包,可以根据阳历日期或阴历日期查询,查询范围从1970-01-01到2099-12-31,返回结果包括:

  • 公历信息:节日、星座
  • 农历信息:宜、忌、冲、煞、神位、胎神、周易、五行、天干地支、彭祖百忌、董公择日法

使用说明


示例

import chinese_permanent_calendar as calendar
import datetime

# 根据阳历日期得到阴历日期的详情
date = datetime.date(2020, 1, 1)
luner_date = calendar.get_lunar_by_gregorian(date)
print("阳历:", luner_date.name, "阴历:", luner_date['LunarDate'])

# 根据阴历得到阳历日期及当天的详情
gregorian_date = calendar.get_gregorian_by_lunar(luner_date['LunarDate'])

# 得到所有节日包含国庆节的日期
date = calendar.get_days_by_festival(['国庆节'])

# 得到所有的日期数据
all_data = calendar.get_all_data(start=datetime.date(2020, 1, 1), end=datetime.date(2020, 2, 1))

属性说明

属性 含义
GregorianDateTime 阳历日期
LunarDateTime 阴历日期
LJie 阴历节日
GJie 阳历节日
Yi
Ji
ShenWei 神位
Taishen 胎神
Chong
SuiSha 岁煞
WuxingJiazi 五行甲子年
WuxingNaYear 五行纳音-年
WuxingNaMonth 五行纳音--月
WuxingNaDay 五行纳音-日
MoonName 月相
XingEast 东方星座-28星宿
XingWest 西方星座-12星座
PengZu 彭祖百忌
JianShen 十二建星
TianGanDiZhiYear 天干地支-奶牛
TianGanDiZhiMonth 天干地支-月
TianGanDiZhiDay 天干地支-日
LMonthName 农历-月份别名
LYear 阴历-年
LMonth 阴历-月
LDay 阴历-日
SolarTermName 节气
GYear 阳历-年
GMonth 阳历-月
GDay 阳历-日
is_weekend 是否为周末
is_weekday 是否为工作日

其他说明

  1. 原始数据文件拿去:cp_calendar.csv.gz
  2. 有任何BUG、改进请提交issue或联系:18813052953@163.com
  3. 本人学生一枚,闲人一个,希望与更多共同学习、共同进步的小伙伴们多多交流学习。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chinese_permanent_calendar-0.1.0.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

File details

Details for the file chinese_permanent_calendar-0.1.0.tar.gz.

File metadata

  • Download URL: chinese_permanent_calendar-0.1.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for chinese_permanent_calendar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f2ce12dac602df61de4a264b7d9aef2327bd82c33ca6d9e247e7239946bd7ec
MD5 12b456c9eb4c70d43d28b905d0ca6779
BLAKE2b-256 9bf4bf075eac1b16512e8bb563eab7f29e22e4f43a2d73419a5661930781ef2c

See more details on using hashes here.

File details

Details for the file chinese_permanent_calendar-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chinese_permanent_calendar-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for chinese_permanent_calendar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e566a456441835933f28d1118189c9f1a0797e6b31beb511159924991239ba7
MD5 1ff3821f78293f4ff4d0e309b9c0fccb
BLAKE2b-256 67fe33a767106e34283b599ca98589d56c9de15bd50caa7531e8faf5069f5c6f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page