Metadata-Version: 2.4
Name: freight-calculator
Version: 0.1.0
Summary: 快递运费计算器：按重量、距离、加急与会员状态计算运费
Author-email: 你的名字 <you@example.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/你的用户名/freight-calculator
Keywords: freight,shipping,logistics,calculator
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# freight-calculator

快递运费计算器：按重量、距离、加急与会员状态计算运费，提供 Python API 与命令行两种用法。

## 安装

```bash
pip install freight-calculator
```

## 计费规则

| 项目 | 规则 |
| --- | --- |
| 首重 | 1kg 以内 10 元 |
| 续重 | 每 1kg 加 2 元（不足 1kg 按 1kg 计） |
| 里程 | 1000km 内免费，超出部分每 500km 加 3 元 |
| 加急 | 附加 8 元 |
| 会员 | 总额 9 折 |

## 作为库使用

```python
from freight_calculator import calc_freight

calc_freight(2, 1200, urgent=True)["total"]   # 23.0
calc_freight(5.6, 3000, urgent=True, member=True)["total"]   # 36.0
```

`calc_freight(weight, distance, urgent=False, member=False)` 返回明细字典：

| 键 | 含义 |
| --- | --- |
| `billing` | 计费重量（kg，整数） |
| `first` | 首重费 |
| `step` | 续重费 |
| `extra` | 超出免费里程的公里数 |
| `km` | 里程费 |
| `urgent` | 加急费 |
| `discount` | 会员折扣 |
| `total` | 应付运费 |

## 命令行交互

```bash
freight-calc
# 或
python -m freight_calculator
```

## 测试

```bash
python tests/test_core.py
```

## 许可证

MIT
