Skip to main content

nonebot-plugin-livetennis

Live tennis scores, today's fixtures and player rankings in your NoneBot2 bot — ATP, WTA, Challenger, ITF and juniors, powered by the Live Tennis API.

Disclosure / 声明: This plugin is written and maintained by the Live Tennis API team — it is vendor-authored. / 本插件由 Live Tennis API 官方团队编写和维护。

English | 简体中文


English

What it does

On-demand chat commands (no background polling, no schedulers):

Command Alias What you get
/tennis live /网球 实时 Matches in play right now, with set/game/point score, who is serving (*) and a break-point marker
/tennis today /网球 今日 Today's scheduled fixtures (UTC), earliest first
/tennis player <name> /网球 球员 <姓名> Player search: country, tour, current world ranking, plays/backhand, birth date
/tennis /网球 Bilingual help

Works on any adapter that can send plain text (supported_adapters=None).

Tier truth

Everything this plugin calls is on the free tier of the Live Tennis API: live scores (score/server/break-point state), players (including a player's own current ranking), fixtures and usage. The free tier allows 30 requests/minute and 100 requests/day — plenty for on-demand chat commands, but honestly not enough for continuous fast polling, which is why this plugin only calls the API when someone asks. (The rank-ordered rankings listing is a Pro endpoint; this plugin does not use it — it shows the ranking carried on the free player object.)

Install

Once the package is published on PyPI (pending):

pip install nonebot-plugin-livetennis
# or
nb plugin install nonebot-plugin-livetennis

Working today, straight from git:

pip install git+https://github.com/livetennisapi/nonebot-plugin-livetennis.git

Then enable it in your bot's pyproject.toml:

[tool.nonebot]
plugins = ["nonebot_plugin_livetennis"]

Configure

Get a free API key at https://livetennisapi.com/subscribe/free and add it to your bot's .env:

LIVETENNIS_API_KEY=your-key-here

Optional settings (defaults shown):

LIVETENNIS_API_BASE=https://api.livetennisapi.com/api/public/v1
LIVETENNIS_TIMEOUT=10.0
LIVETENNIS_MAX_LINES=12

Example output

Live now / 实时比分 (1):
[ATP] Cincinnati Masters QF
  Carlos Alcaraz* vs Jannik Sinner — 6-4 3-3 (30-40) [BP 破发点]

* marks the server; [BP] appears when the receiver holds a break point (receiver at AD, or at 40 with the server on 0/15/30 — never shown in tiebreaks or when the state is unknown).

Development

pip install -e . --group dev
ruff check . && ruff format --check .
pytest

Docs: https://docs.livetennisapi.com · Spec: livetennisapi/openapi


简体中文

功能

按需触发的聊天指令(无后台轮询、无定时任务):

指令 别名 内容
/tennis live /网球 实时 当前进行中的比赛:盘/局/分比分、发球方(*)与破发点标记
/tennis today /网球 今日 今日赛程(UTC),按时间先后排列
/tennis player <name> /网球 球员 <姓名> 球员搜索:国籍、巡回赛、当前世界排名、持拍手/反手、出生日期
/tennis /网球 双语帮助

支持所有能发送纯文本的适配器(supported_adapters=None)。

套餐说明(如实)

本插件调用的全部接口均属于 Live Tennis API 的免费套餐:实时比分(比分/发球方/破发点状态)、球员(含球员自身的当前排名)、赛程与用量查询。免费套餐限额为每分钟 30 次、每天 100 次——足够按需查询使用,但不适合持续高频轮询,因此本插件只在用户发出指令时才调用接口。(按名次排序的排名列表属于 Pro 接口,本插件不使用它,而是展示免费球员对象上自带的排名。)

安装

PyPI 发布后(待发布):

pip install nonebot-plugin-livetennis
# 或
nb plugin install nonebot-plugin-livetennis

当前可直接从 git 安装:

pip install git+https://github.com/livetennisapi/nonebot-plugin-livetennis.git

然后在机器人的 pyproject.toml 中启用:

[tool.nonebot]
plugins = ["nonebot_plugin_livetennis"]

配置

在 https://livetennisapi.com/subscribe/free 免费申请 API 密钥,写入机器人的 .env:

LIVETENNIS_API_KEY=你的密钥

可选配置(默认值如下):

LIVETENNIS_API_BASE=https://api.livetennisapi.com/api/public/v1
LIVETENNIS_TIMEOUT=10.0
LIVETENNIS_MAX_LINES=12

输出示例

Live now / 实时比分 (1):
[ATP] Cincinnati Masters QF
  Carlos Alcaraz* vs Jannik Sinner — 6-4 3-3 (30-40) [BP 破发点]

* 表示发球方;当接发球方握有破发点时显示 [BP 破发点](接发球方 AD,或接发球方 40 而发球方为 0/15/30;抢七局不显示,状态未知时不显示)。

文档:https://docs.livetennisapi.com · 接口规范:livetennisapi/openapi

License

MIT © Live Tennis API

Metadata

Release files for nonebot-plugin-livetennis 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-livetennis 0.1.0
File Size Uploaded Provenance
nonebot_plugin_livetennis-0.1.0.tar.gz 12.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-livetennis 0.1.0
File Interpreter ABI Platform
nonebot_plugin_livetennis-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.7 kB

Release files / nonebot_plugin_livetennis-0.1.0.tar.gz

Download URL nonebot_plugin_livetennis-0.1.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
21f1f858486e46c8ab0e2a14949aed76d6811b4c689632cc194e120d32554b0a
BLAKE2b-256 checksum
How to use checksums
fcc2db4dd9cf9032db39fdba2abf107736c11ed10b6fc99d752114994cbbd040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Release files / nonebot_plugin_livetennis-0.1.0-py3-none-any.whl

Download URL nonebot_plugin_livetennis-0.1.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
463715a9850241462bf66397054a368d84d9e9beb6439f95b2f0b49264cc1aa7
BLAKE2b-256 checksum
How to use checksums
2831aad5f22c154213a59a8b44c2f363518bd61ca3ec82def322e6f77000b491
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Security for nonebot-plugin-livetennis 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nonebot_plugin_livetennis-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page