Skip to main content

satori-python

latest release Licence PyPI PyPI - Python Version

基于 Satori 协议的 Python 开发工具包

协议介绍

Satori Protocol

协议端

目前提供了 satori 协议实现的有:

使用该 SDK 的框架

安装

安装完整体:

pip install satori-python

只安装基础部分:

pip install satori-python-core

只安装客户端部分:

pip install satori-python-client

只安装服务端部分:

pip install satori-python-server

官方适配器

适配器 安装 路径
Satori pip install satori-python-adapter-satori satori.adapters.satori
OneBot V11 pip install satori-python-adapter-onebot11 satori.adapters.onebot11.forward, satori.adapters.onebot11.reverse
Console pip install satori-python-adapter-console satori.adapters.console
Milky pip install satori-python-adapter-milky satori.adapters.milky.main, satori.adapters.milky.webhook, satori.adapters.milky.sse
QQ pip install satori-python-adapter-qq satori.adapters.qq.main, satori.adapters.qq.websocket
WxClaw pip install satori-python-adapter-wxclaw satori.adapters.wxclaw

社区适配器

适配器 安装 路径
nekobox(Lagrange) pip install nekobox nekobox.main

使用

客户端:

from satori import EventType
from satori.event import MessageEvent
from satori.client import Account, App, WebsocketsInfo

app = App(WebsocketsInfo(port=5140))

@app.register_on(EventType.MESSAGE_CREATED)
async def on_message(account: Account, event: MessageEvent):
    if event.user.id == "xxxxxxxxxxx":
        await account.send(event, "Hello, World!")

app.run()

服务端:

from satori import Api
from satori.server import Server

server = Server(port=5140)

@server.route(Api.MESSAGE_CREATE)
async def on_message_create(*args, **kwargs):
    return [{"id": "1234", "content": "example"}]

server.run()

文档

请阅读 仓库文档

示例

架构

graph LR
    subgraph Server
        server -- run --> asgi
        server -- register --> router -- mount --> asgi
        server -- apply --> provider -- mount  --> asgi
        provider -- event,logins --> server
    end
    subgraph Client
        config -- apply --> app -- run --> network
        app -- register --> listener
        network -- account,event --> listener
        listener -- handle --> account -- session --> api
    end
    
    api -- request --> asgi -- response --> api
    server -- raw-event --> asgi -- websocket/webhook --> network

Metadata

Release files for satori-python-core 1.3.10

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

Source distribution (sdist)

Source distribution for satori-python-core 1.3.10
File Size Uploaded Provenance
satori_python_core-1.3.10.tar.gz 22.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for satori-python-core 1.3.10
File Interpreter ABI Platform
satori_python_core-1.3.10-py3-none-any.whl Python 3 none any Details

Total release size: 46.7 kB

Release files / satori_python_core-1.3.10.tar.gz

Download URL satori_python_core-1.3.10.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7f0a14877a359c146e89055da88c4ff4c899d0a3d81ea7e97a980d681c566754
BLAKE2b-256 checksum
How to use checksums
cea08be9da892442d7b47b31c33cbe2cadc78ef938ac2cbdc81eea0209009cf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.13.2 CPython/3.11.17 Linux/7.0.0-1017-azure

Release files / satori_python_core-1.3.10-py3-none-any.whl

Download URL satori_python_core-1.3.10-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bd94198ef6d8dbac27981fa455ffddcad8b40ad7e17cc934f70c61874e1d665
BLAKE2b-256 checksum
How to use checksums
82f61396c147a1bc48fde6076875d26d0634ee2fa649a74faa9cbff31abaa51e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.13.2 CPython/3.11.17 Linux/7.0.0-1017-azure

Security for satori-python-core 1.3.10

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

1.3.10 This release

2 release files No 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