NapCat SDK for Python - Fully typed and async ready
Project description
NapCat-SDK for Python
Type-Safe • Async-Ready • Framework-Free
Stop guessing parameter types. Let the IDE do the work.
告别查文档,享受 100% 类型覆盖 带来的极致补全体验。
⚡ The "IDE Magic"
这就是为什么你应该选择 NapCat-SDK:
| 智能 API 补全 + 精准参数提示 | 原生开发体验 + 零心智负担 |
|---|---|
👆 真正的 140+ API 全量类型覆盖,每一次按键都有 IDE 的守护。
✨ Features
- 🚀 完全异步: 基于
websockets+asyncio,高并发无压力。 - 💎 强类型优先: 每一个 Event、每一个 MessageSegment 都有严格定义。
- 🔌 双模式支持: Client (正向) / Server (反向) 随意切换。
- 🛠 零依赖: 仅依赖
websockets和orjson,极其轻量。
📸 Quick Look
🖱️ 点击复制代码文本
import asyncio
from napcat.client import NapCatClient
from napcat.types import GroupMessageEvent
async def main():
async with NapCatClient(ws_url="...", token="...") as client:
async for event in client.events():
match event:
case GroupMessageEvent(raw_message="ping"):
await event.reply("pong!")
if __name__ == "__main__":
asyncio.run(main())
📦 Installation
uv add napcat-sdk
# or
pip install napcat-sdk
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
napcat_sdk-0.2.4.tar.gz
(31.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file napcat_sdk-0.2.4.tar.gz.
File metadata
- Download URL: napcat_sdk-0.2.4.tar.gz
- Upload date:
- Size: 31.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e08621bcc17dfc3ff7872d5210db0f794539c9843f452a8c2fc18ea0763b25f
|
|
| MD5 |
1e33da5b8ba0c3a927cac1195ee75624
|
|
| BLAKE2b-256 |
8621d1476e6e51d49ac9fa4d637d0933aabaaa39878ae9b52069f83bc29ee561
|
File details
Details for the file napcat_sdk-0.2.4-py3-none-any.whl.
File metadata
- Download URL: napcat_sdk-0.2.4-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60d66ecc43b256f2ce6b471476676178a6ad56005af4ecd7767582104fbc60d0
|
|
| MD5 |
3544cd10084b0c411fa291bbefae918d
|
|
| BLAKE2b-256 |
f894c631847a459c03a7b92c0249c99412c5248005ee345b0a1e4ed6c84f5272
|