Skip to main content

介绍

这是 source2RSS 服务端的 Python 版客户端程序,功能有:

  • 向服务端发送文章,从而通过 RSS 跟踪一些情况,比如在程序出错时,使用本客户端发送日志

使用

创建客户端实例

from source2RSS_client import S2RProfile, Source2RSSClient

s2r_profile: S2RProfile = {
    "url": "http://127.0.0.1:8536",
    "username": "vfly2",
    "password": "123456",
    "source_name": "source2rss_severe_log",
}
s2r_c = Source2RSSClient.create(s2r_profile)

发送文章

异步发送

response = await s2r_c.post_article("test_client", "test_client summary")

同步发送

response = s2r_c.sync_post_article("test_client", "test_client summary")

发送测试文章

在第一次使用时,想必都希望能立马看到效果,验证功能是否正常。

在创建客户端实例时,可以让其立刻发送一个文章来进行测试,有两种办法触发这一点:

  1. 创建实例时,利用传参控制 Source2RSSClient.create(s2r_profile, send_test=True)
  2. 添加环境变量,以 Linux 为例 SOURCE2RSS_CLIENT_SEND_TEST=true

Metadata

Release files for source2RSS-client 0.1.2

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

Source distribution (sdist)

Source distribution for source2RSS-client 0.1.2
File Size Uploaded
source2rss_client-0.1.2.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for source2RSS-client 0.1.2
File Interpreter ABI Platform
source2rss_client-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.5 kB

Release files / source2rss_client-0.1.2.tar.gz

Download URL source2rss_client-0.1.2.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b30c03736b4d41882e832636eaff93b96461fb5272a2f37db5d28f59128a5685
BLAKE2b-256 checksum
How to use checksums
4ea09d616dc31eb77d722fabe22aef09af14432bef5f0df35209272c0816d98f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / source2rss_client-0.1.2-py3-none-any.whl

Download URL source2rss_client-0.1.2-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cecfb2585edca160cdc61eb1d1f2192f773d0a982a22a4ca7620ec68f2a450bb
BLAKE2b-256 checksum
How to use checksums
cfe960756d19cb9713681c259217a0a2c3dfa5b2eab775651d4283c760b4d121
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

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