{"id":20129813,"url":"https://github.com/aixcyi/ccd","last_synced_at":"2026-03-27T03:10:35.226Z","repository":{"id":63026410,"uuid":"543520156","full_name":"aixcyi/CCD","owner":"aixcyi","description":"力求简单、稳定、高效的农历 Python 库。","archived":false,"fork":false,"pushed_at":"2022-11-11T08:37:07.000Z","size":125,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T16:12:30.394Z","etag":null,"topics":["date","python","python-library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aixcyi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-30T09:16:57.000Z","updated_at":"2022-11-12T03:12:03.000Z","dependencies_parsed_at":"2023-01-22T00:01:58.661Z","dependency_job_id":null,"html_url":"https://github.com/aixcyi/CCD","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aixcyi%2FCCD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aixcyi%2FCCD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aixcyi%2FCCD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aixcyi%2FCCD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aixcyi","download_url":"https://codeload.github.com/aixcyi/CCD/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065282,"owners_count":21041872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date","python","python-library"],"created_at":"2024-11-13T20:36:11.353Z","updated_at":"2026-03-27T03:10:35.169Z","avatar_url":"https://github.com/aixcyi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eChinese Calendar Date\u003c/h1\u003e\n\n力求简单、稳定、高效的农历日期 Python 库。\n\n## 功能一览\n\n- [x] 农历日期的判等和比较\n- [x] 农历日期的加减（与`datetime.timedelta`）\n- [x] 农历日期的数字化和汉字化\n- [x] 公农历的互相转换\n  - [x] 范围有限的快速转换（`FastCCD`）\n  - [x] 范围无限的计算转换（`EphemCCD`）\n- [ ] 支持 Pickle 协议\n- [x] 中文文档注释\n\n## 兼容性\n\n目前仅支持使用 Python 3.11 及以上版本运行。  \n如果希望支持旧版本，可以提出 [Issue](#问题反馈) 并注明希望支持的最低版本，或点赞表态，也欢迎参与翻译。\n\n## 快速上手\n\n#### 安装\n\n```shell\npip install CCD\n```\n\n#### 使用\n\n```python\nfrom datetime import date, timedelta\nfrom ccd import FastCCD\n\ngcd = date.today()\nprint(str(gcd))  # '2020-06-20'\n\nccd = FastCCD.from_date(gcd)\nprint(str(ccd))  # '农历2020年闰四月廿九'\nprint(repr(ccd))  # 'ccd.base.FastCCD(2020, 4, 29, True)'\n\nccd += timedelta(days=1)\nprint(str(ccd))  # '农历2020年五月初一'\nprint(repr(ccd))  # 'ccd.base.FastCCD(2020, 5, 1, False)'\n\ngcd = ccd.to_date()\nprint(str(gcd))  # '2020-06-21'\n```\n\n#### 说明\n\n农历日期类有以下几个：\n\n- `ccd.EphemCCD`，无限范围。需要安装 [PyEphem](https://pypi.org/project/ephem/) 库后才可用。\n- `ccd.FastCCD`，有限范围。无论何时都可用。\n- `ccd.ChineseCalendarDate`，无论何时都可用。\n  - 默认情况下等同于 `FastCCD` 。\n  - 安装 [PyEphem](https://pypi.org/project/ephem/) 库后等同于 `EphemCCD` 。\n\n\n## 问题反馈\n\n码云：[https://gitee.com/aixcyi/CCD/issues](https://gitee.com/aixcyi/CCD/issues)  \nGitHub：[https://github.com/aixcyi/CCD/issues](https://github.com/aixcyi/CCD/issues)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faixcyi%2Fccd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faixcyi%2Fccd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faixcyi%2Fccd/lists"}