Metadata-Version: 2.4
Name: time-server-pkg
Version: 0.1.0
Summary: 提供JSON-RPC接口的时间服务器，支持获取不同时区的当前时间
Home-page: https://github.com/yourusername/time-server-pkg
Author: Your Name
Author-email: Your Name <your.email@example.com>
License: MIT License
        
        Copyright (c) 2024 Time Server Package Contributors
        
        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.
        
Keywords: time-server,json-rpc,fastapi,timezone
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn>=0.22.0
Requires-Dist: pytz>=2023.3
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Time Server Package

一个提供JSON-RPC接口的时间服务器Python包，支持获取不同时区的当前时间。

## 功能特性

- 提供`tools/get_current_time` JSON-RPC方法
- 支持指定时区获取时间
- 基于FastAPI框架构建
- 包含命令行入口点

## 安装

```bash
pip install time-server-pkg
```

## 使用方法

### 作为命令行工具运行

```bash
time-server
```

### 作为Python模块导入

```python
from time_server_pkg import app, get_current_time

# 获取当前时间
print(get_current_time())

# 获取指定时区的时间
print(get_current_time("Asia/Shanghai"))
```

## API接口

服务器默认在`http://localhost:8000`启动，提供以下JSON-RPC方法：

### tools/get_current_time

获取当前时间，可选参数：

- `timezone`: 时区字符串，例如`"Asia/Shanghai"`, `"America/New_York"`等

示例请求：
```json
{
  "jsonrpc": "2.0",
  "method": "tools/get_current_time",
  "params": {"timezone": "Asia/Shanghai"},
  "id": 1
}
```

示例响应：
```json
{
  "jsonrpc": "2.0",
  "result": "2023-11-15 14:30:45 CST",
  "id": 1
}
```

## 技术栈

- Python 3.7+
- FastAPI
- Uvicorn
- pytz

## 许可证

MIT License
