Metadata-Version: 2.2
Name: calcchinesecalendar
Version: 2.6.5b3
Summary: Native Python bindings for the CalcChineseCalendar lunar ephemeris, astronomy, and calendar engine.
Author: lzray-universe
License: MIT License
         
         Copyright (c) 2026 lzray-universe
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: C++
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Homepage, https://github.com/lzray-universe/CalcChineseCalendar/
Project-URL: Repository, https://github.com/lzray-universe/CalcChineseCalendar/
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# calcchinesecalendar

`calcchinesecalendar` packages the `lunar` engine as a native Python extension
for Chinese calendar, almanac, and astronomy computations.

It is intended for direct use from Python code and for installation from PyPI.

The upstream C++ repository and the full reference documentation are available
at:

- GitHub: https://github.com/lzray-universe/CalcChineseCalendar/

If you need the full CLI reference, C++ API, C API, i18n details, repository
layout, or release artifacts, use the GitHub repository as the primary
reference.

## Installation

```bash
pip install calcchinesecalendar
```

## Quick start

```python
import calcchinesecalendar as ccc

print(ccc.version())

data = ccc.day("@series", "2025-06-01")
print(data["data"]["phase_name"])

ganzhi = ccc.ganzhi("@series", "2025-09-07")
print(ganzhi["data"]["day"]["text"])
```

## Using BSP ephemerides

The first argument of the public APIs is the ephemeris selector:

- use `@series` to force the built-in VSOP87A + ELPMPP02 fallback
- pass a BSP file path such as `de442.bsp` to use JPL DE ephemerides

Example:

```python
import calcchinesecalendar as ccc

data = ccc.day("de442.bsp", "2025-06-01")
print(data["data"]["phase_name"])
```

## Public API overview

The package exposes:

- native core APIs such as `core_day`, `ganzhi`, `ganzhi_month`, and `calc_eot`
- high-level helpers such as `day`, `monthview`, `at`, `convert`, `search`,
  `eclipse`, `festival`, `almanac`, and `info`
- raw `run` and `run_json` access for advanced command-style use
- a `Lunar` client class for shared defaults such as `lang` and
  `eclipse_method`

## High-level helper example

```python
import calcchinesecalendar as ccc

result = ccc.search(
    "@series",
    "next full moon",
    from_time="2025-06-01T00:00:00+08:00",
    count=2,
)

for item in result["data"]:
    print(item["code"], item["loc_iso"])
```

## `Lunar` client example

```python
import calcchinesecalendar as ccc

lunar = ccc.Lunar(lang="en", eclipse_method="fast")
result = lunar.day("@series", "2025-06-01")
print(result["data"]["phase_name"])
```

## Notes

- Python package name: `calcchinesecalendar`
- Import name: `calcchinesecalendar`
- Python 3.10 or newer is required
- The package bundles the native extension; a compiler is not required for
  normal wheel installation

For the full CLI, C++ API, C API, i18n documentation, and repository-level
usage notes, see the GitHub C++ repository:

- https://github.com/lzray-universe/CalcChineseCalendar/
