semvec/pypi-packages huggingface dataset:
abjax 0.0.1
High-performance Python library for AB testing analysis with JAX and FastAPI
Requires Python: >=3.9
Keywords: ab-testing, cuped, jax, statistics, variance-reduction

# ABJAX

[![Release](https://img.shields.io/github/v/release/thomaspinder/ABJAX)](https://img.shields.io/github/v/release/thomaspinder/ABJAX)
[![Build status](https://img.shields.io/github/actions/workflow/status/thomaspinder/ABJAX/main.yml?branch=main)](https://github.com/thomaspinder/ABJAX/actions/workflows/main.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/thomaspinder/ABJAX/branch/main/graph/badge.svg)](https://codecov.io/gh/thomaspinder/ABJAX)
[![Commit activity](https://img.shields.io/github/commit-activity/m/thomaspinder/ABJAX)](https://img.shields.io/github/commit-activity/m/thomaspinder/ABJAX)
[![License](https://img.shields.io/github/license/thomaspinder/ABJAX)](https://img.shields.io/github/license/thomaspinder/ABJAX)

AB testing with JAX

- **Github repository**: <https://github.com/thomaspinder/ABJAX/>
- **Documentation** <https://thomaspinder.github.io/ABJAX/>

## Getting started with your project

### 1. Create a New Repository

First, create a repository on GitHub with the same name as this project, and then run the following commands:

```bash
git init -b main
git add .
git commit -m "init commit"
git remote add origin git@github.com:thomaspinder/ABJAX.git
git push -u origin main
```

### 2. Set Up Your Development Environment

Then, install the environment and the pre-commit hooks with

```bash
make install
```

This will also generate your `uv.lock` file

### 3. Run the pre-commit hooks

Initially, the CI/CD pipeline might be failing due to formatting issues. To resolve those run:

```bash
uv run pre-commit run -a
```

### 4. Commit the changes

Lastly, commit the changes made by the two steps above to your repository.

```bash
git add .
git commit -m 'Fix formatting issues'
git push origin main
```

You are now ready to start development on your project!
The CI/CD pipeline will be triggered when you open a pull request, merge to main, or when you create a new release.

To finalize the set-up for publishing to PyPI, see [here](https://fpgmaas.github.io/cookiecutter-uv/features/publishing/#set-up-for-pypi).
For activating the automatic documentation with MkDocs, see [here](https://fpgmaas.github.io/cookiecutter-uv/features/mkdocs/#enabling-the-documentation-on-github).
To enable the code coverage reports, see [here](https://fpgmaas.github.io/cookiecutter-uv/features/codecov/).

## Releasing a new version

- Create an API Token on [PyPI](https://pypi.org/).
- Add the API Token to your projects secrets with the name `PYPI_TOKEN` by visiting [this page](https://github.com/thomaspinder/ABJAX/settings/secrets/actions/new).
- Create a [new release](https://github.com/thomaspinder/ABJAX/releases/new) on Github.
- Create a new tag in the form `*.*.*`.

For more details, see [here](https://fpgmaas.github.io/cookiecutter-uv/features/cicd/#how-to-trigger-a-release).

---

Repository initiated with [fpgmaas/cookiecutter-uv](https://github.com/fpgmaas/cookiecutter-uv).
mcp-12306 0.1.8
A simple MCP server to query ticket information in 12306.
Requires Python: >=3.10
Keywords: automation, llm, mcp

# mcp_12306

## 项目简介

`mcp_12306` 是一个基于 MCP（Model Context Protocol）协议的 12306 火车票查询服务端项目。  
它支持通过自然语言或 API 查询中国铁路 12306 的余票信息、车站代码等，并支持 Redis 缓存加速查询。

## 主要功能

- **火车票余票查询**  
  支持指定出发站、到达站、出发日期、乘客类型（成人/学生）等参数，查询 12306 实时余票信息。

- **车站代码/名称查询**  
  可根据车站中文名查询对应的 12306 车站代码，或反查车站名称。

- **Redis 缓存支持**  
  查询结果可自动缓存到 Redis，提升高频查询性能。

- **MCP 工具集成**  
  以工具（tool）的形式对外暴露接口，便于 LLM/自动化系统集成。

- **命令行参数灵活**  
  支持自定义服务端口、传输方式（stdio/sse）、是否启用 Redis 等。

---

## 安装与运行

### 1. 安装依赖

```bash
uv pip install mcp-12306
```

### 2. 启动 Redis（可选）

如需启用 Redis 缓存，需先启动本地 Redis 服务（默认端口 6379）。

```bash
# Linux
redis-server

# Windows（需提前安装 Redis for Windows 或 Memurai）
redis-server.exe
```

### 3. 启动服务

#### 3.1 python 启动
进入 `mcp_12306` 目录后，使用以下命令启动服务：

```bash
python -m mcp_12306 --redis 6379
```

#### 3.2 uvx 启动

不带 Redis 启动：
```bash
uvx mcp-12306
```
带 Redis 启动：
```bash
uvx mcp-12306 --redis 6379
```

- `--redis`：指定 Redis 端口，不填则不启用 Redis

---

## 主要接口/工具

- `query_tickets`：查询火车票信息  
  - 参数：`from_station`（出发站），`to_station`（到达站），`train_date`（出发日期），`purpose_codes`（乘客类型）
- `get_station_code`：获取车站代码  
  - 参数：`station_name`（车站中文名）
- `get_station_name`：获取车站名称  
  - 参数：`station_code`（车站代码）

---

## 项目结构

```
 mcp_12306/
    ├── LICENSE
    ├── mcp_12306/
    │   ├── __init__.py
    │   ├── __main__.py
    │   ├── mcp_12306_server.py
    │   ├── query_12306.py
    │   └── station.txt
    ├── mcp_12306.egg-info/
    ├── pyproject.toml
    ├── README.md
    └── uv.lock
```

---

## 后续工作计划

- [ ] 支持更多 12306 查询接口
    - [ ] 车次时刻表
    - [ ] 列车中转查询
- [ ] 增强异常处理与日志记录
- [ ] 提供 Web UI 或 API 文档
- [ ] 支持 Docker 一键部署
- [ ] 国际化与多语言支持

---

## 贡献与反馈
  
如有疑问可联系维护者：zhengchenguang315@gmail.com

---