Skip to main content

NapCat SDK for Python - Fully typed and async ready

Project description

NapCat Logo

NapCat-SDK for Python

Type-SafeAsync-ReadyFramework-Free

PyPI License Python Version Typing

Stop guessing parameter types. Let the IDE do the work.

告别查文档,享受 100% 类型覆盖 带来的极致补全体验。


⚡ The "IDE Magic"

这就是为什么你应该选择 NapCat-SDK:

智能 API 补全 + 精准参数提示 原生开发体验 + 零心智负担
API Completion Native Dev

👆 真正的 140+ API 全量类型覆盖,每一次按键都有 IDE 的守护。


✨ Features

  • 🚀 完全异步: 基于 websockets + asyncio,高并发无压力。
  • 💎 强类型优先: 每一个 Event、每一个 MessageSegment 都有严格定义。
  • 🔌 双模式支持: Client (正向) / Server (反向) 随意切换。
  • 🛠 零依赖: 仅依赖 websocketsorjson,极其轻量。

📸 Quick Look

Code Example
🖱️ 点击复制代码文本
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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napcat_sdk-0.2.4-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

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

Hashes for napcat_sdk-0.2.4.tar.gz
Algorithm Hash digest
SHA256 1e08621bcc17dfc3ff7872d5210db0f794539c9843f452a8c2fc18ea0763b25f
MD5 1e33da5b8ba0c3a927cac1195ee75624
BLAKE2b-256 8621d1476e6e51d49ac9fa4d637d0933aabaaa39878ae9b52069f83bc29ee561

See more details on using hashes here.

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

Hashes for napcat_sdk-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 60d66ecc43b256f2ce6b471476676178a6ad56005af4ecd7767582104fbc60d0
MD5 3544cd10084b0c411fa291bbefae918d
BLAKE2b-256 f894c631847a459c03a7b92c0249c99412c5248005ee345b0a1e4ed6c84f5272

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page