CelestialCalendar for Python
celestial-calendar provides Python bindings for CelestialCalendar's astronomical calculations, Gregorian and
Chinese Lunar conversions, and Jieqi (节气) moments. The wheel contains the native library for its target platform;
no compiler or separate CelestialCalendar installation is required at runtime. Python 3.11 or newer is supported.
Install
Install the wheel for your platform from PyPI:
python -m pip install celestial-calendar
The same four wheel bytes are published to PyPI and the matching GitHub release:
| System | Architecture | Required tag in the wheel filename |
|---|---|---|
| Linux (manylinux 2.28) | x86_64 | manylinux_2_28_x86_64 |
| Linux (manylinux 2.28) | aarch64 | manylinux_2_28_aarch64 |
| macOS 14 or newer | arm64 | macosx_14_0_arm64 |
| Windows | AMD64 | win_amd64 |
Linux wheel filenames may contain additional compatible manylinux tags. Each is a py3 wheel for Python 3.11 or
newer on that platform.
No wheel is published for other platforms, such as Intel macOS, Windows on ARM, or musl-based Linux.
API
import celestial_calendar as celestial
ut1 = celestial.CivilDateTime(2026, 8, 16, 0.5)
jde = celestial.ut1_to_jde(ut1)
winter_solstice = celestial.jieqi_moment(2026, celestial.Jieqi.DONGZHI)
print(jde)
print(winter_solstice)
The public API uses immutable dataclasses and enums. Civil moments retain a day fraction and identify their time scale
in the function or field name; they are not silently converted to Python's narrower datetime domain.
Wrong input types, including members of the wrong enum, raise TypeError. Values rejected by finiteness, range, or
domain checks raise ValueError. A failure reported by the native boundary raises CelestialError. Its operation
attribute names the public function, and its recorded attribute says whether the message came from the native error
channel. A legitimate absence remains None or ().
jieqi_moment(year, jieqi) accepts Gregorian years in [401, 32766].
Lunar conversions use algorithm-specific year windows; query them with supported_lunar_year_range(algorithm).
moon_phase_moments(year, phase), solar_longitude_roots(year, longitude_deg), and new_moons_in_year(year) accept
Gregorian years in [1, 32766].
delta_t(year, model) accepts a finite decimal Gregorian year. Three models have additional bounds:
| Model | Year domain |
|---|---|
DeltaTModel.ALGO1 |
year >= -4000 |
DeltaTModel.ALGO3 |
year < 3000 |
DeltaTModel.ALGO4 |
year < 2035 |
DeltaTModel.DEFAULT, DeltaTModel.ALGO2, and DeltaTModel.ALGO5 have no model-specific year bound.
new_moons_after(jde, count) accepts count in [0, 4096]; zero returns (). The upper bound keeps one native
output buffer at or below 32 KiB.
中文
celestial-calendar 把 CelestialCalendar 的天文计算与公历/阴历转换包装为自带原生库的 Python 包,
运行时不需编译器或另行安装 CelestialCalendar。需要 Python 3.11 或更新版本;支持平台见上面的 wheel 表。
import celestial_calendar as celestial
result = celestial.gregorian_to_lunar(celestial.LunarAlgorithm.ALGO3, celestial.GregorianDate(2026, 8, 15))
公开 API 使用不可变 dataclass 与枚举;时间尺度、年域与错误契约见上面的 API 节。
The project is licensed under GPL-3.0-or-later. Source and issue tracking are at https://github.com/0xf3cd/celestial-calendar.
Release files for celestial-calendar 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| celestial_calendar-0.6.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| celestial_calendar-0.6.0-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.26+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| celestial_calendar-0.6.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.28+ ARM64, Linux glibc 2.24+ ARM64 | Details |
| celestial_calendar-0.6.0-py3-none-macosx_14_0_arm64.whl | Python 3 | none | macOS 14.0+ ARM64 | Details |
Total release size: 1.2 MB
Release files / celestial_calendar-0.6.0-py3-none-win_amd64.whl
| Download URL | celestial_calendar-0.6.0-py3-none-win_amd64.whl |
|---|---|
| Size | 388.9 kB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
876279bd10bae8afd675b7dd5e015487f3401136c63eb0858206ef1b11ba306e
|
|
BLAKE2b-256 checksum How to use checksums |
f0af2c59435f42e026ec5f5cebfdd8f431c52d2948b4792edd8215af6f3f35c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / celestial_calendar-0.6.0-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
| Download URL | celestial_calendar-0.6.0-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 318.1 kB |
| Tags | Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
50378aafb63f7ae3a80334d5398d0afddea57d5a3d8173ee6cab47480cef3cb1
|
|
BLAKE2b-256 checksum How to use checksums |
fea36e8ffd2474d7d617c959a8f787ccc5249ff6f2b4c331d2e81a1f1109c35f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / celestial_calendar-0.6.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | celestial_calendar-0.6.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 298.9 kB |
| Tags | Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
c4e7753b5380b90325c61b9a4e829c0e788504cf809b6145ac6a1eef2abaee27
|
|
BLAKE2b-256 checksum How to use checksums |
b1d826b7368bd6e03697fa234302e97c8cbb28b6de56f18055d10854ad0e10d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / celestial_calendar-0.6.0-py3-none-macosx_14_0_arm64.whl
| Download URL | celestial_calendar-0.6.0-py3-none-macosx_14_0_arm64.whl |
|---|---|
| Size | 175.7 kB |
| Tags | Python 3 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
29a265a8488f6b33c97730e508ba261638371b595062384b592d8ee52d3e7925
|
|
BLAKE2b-256 checksum How to use checksums |
1149e61ffd24d5bf08921208e51c608b65fae3ffcbac89f18a580fb4d71e7c35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency log