Metadata-Version: 2.5
Name: build_item
Version: 0.1.2
Summary: 一个用于学习 Python 公共库构建和发布的示例工程
Requires-Python: >=3.14
Requires-Dist: markdown>=3.5
Requires-Dist: python-dateutil>=2.8
Description-Content-Type: text/markdown

# build_item

一个用于学习 Python 公共库构建和发布的示例工程。该库提供了两个简单的函数：`start_fn` 和 `end_fn`，用于打印"开始"和"结束"，可作为快速上手 `setuptools` / `hatchling` 打包流程的参考模板。

## 功能特性

- 轻量、零配置：安装即可直接导入使用
- 提供两个入门示例函数，演示包内模块的组织与导出
- 演示标准 `src` 布局与 `pyproject.toml`（Hatchling）构建配置
- 随包引入 `python-dateutil` 和 `Markdown` 依赖，展示依赖声明方式

## 安装

### 通过 pip 安装（推荐）

```bash
pip install build-item
```

### 从源码安装

```bash
git clone <your-repo-url>
cd build_item
pip install .
```

## 快速开始

```python
from build_item import start_fn, end_fn

start_fn()  # 输出：开始
end_fn()    # 输出：结束
```

## 使用说明

| 函数      | 说明                       | 输出   |
| --------- | -------------------------- | ------ |
| `start_fn` | 打印"开始"                 | `开始` |
| `end_fn`   | 打印"结束"                 | `结束` |

### 直接通过模块路径调用

也可以单独从子模块导入：

```python
from build_item.start import start_fn
from build_item.end import end_fn
```

## 开发与构建

### 环境准备

```bash
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux / macOS
source .venv/bin/activate

pip install build hatchling
```

### 构建发行包

```bash
python -m build
```

构建完成后，会在 `dist/` 目录下生成 `.whl` 和 `.tar.gz` 文件。

### 本地验证安装

```bash
pip install dist/build_item-0.1.1-py3-none-any.whl
python -c "from build_item import start_fn, end_fn; start_fn(); end_fn()"
```

### 发布到 PyPI

```bash
pip install twine
twine upload dist/*
```

> 发布前请先在 [PyPI](https://pypi.org/) 注册账号，并配置 `TWINE_USERNAME` / `TWINE_PASSWORD` 或使用 API Token。

## 项目结构

```
build_item/
├── src/
│   └── build_item/
│       ├── __init__.py      # 包入口，导出 start_fn 和 end_fn
│       ├── start/
│       │   └── __init__.py  # start_fn 实现
│       └── end/
│           └── __init__.py  # end_fn 实现
├── pyproject.toml           # 构建与项目配置（Hatchling）
└── README.md
```

## 要求

- Python >= 3.14
- 第三方依赖：`python-dateutil>=2.8`、`Markdown>=3.5`

## 许可证

请根据项目实际情况填写许可证（例如 MIT、Apache-2.0 等），并在 `pyproject.toml` 中同步声明 `license` 字段。
