Metadata-Version: 2.4
Name: day-calculator-liora
Version: 0.1.0
Summary: 支持公元前后日期的星期计算器
Author: liora
Keywords: calendar,weekday,date,calculator
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# day-calculator-liora

一个支持“公元前 / 公元后”日期的星期计算器，纯标准库实现，无第三方依赖。

## 安装

```bash
pip install day-calculator-liora
```

## 用法

### 1. 命令行交互

```bash
day-calculator
```

按提示输入日期，格式为 `年/月/日`（公元前用负数，如 `-1` 表示公元前 1 年）：

```
********************星期计算器********************
请输入日期（以年/月/日形式，用负数表示公元前年份）：2024/11/27
这一天是星期三
```

### 2. 作为函数调用

```python
from day_calculator import weekday

weekday(2024, 11, 27)   # 3  -> 星期三
weekday(-1, 1, 1)       # 6  -> 星期六
```

返回值约定：`0` = 星期日，`1` = 星期一，……，`6` = 星期六。

## 说明

- 闰年判定：能被 4 整除且不能被 100 整除，或能被 400 整除。
- 全部按“前推格里高利历”计算，1582 年 10 月以前的历史日期与当时实际使用的儒略历会有差异。
- 公元前年份内部按天文纪年换算（公元前 1 年对应天文 0 年）。

## License

MIT
