Skip to main content

Client Program of source2RSS

Project description

介绍

这是 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

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

source2rss_client-0.1.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

source2rss_client-0.1.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file source2rss_client-0.1.2.tar.gz.

File metadata

  • Download URL: source2rss_client-0.1.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for source2rss_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b30c03736b4d41882e832636eaff93b96461fb5272a2f37db5d28f59128a5685
MD5 9d143c18a7bd23be7e368f883f787bc4
BLAKE2b-256 4ea09d616dc31eb77d722fabe22aef09af14432bef5f0df35209272c0816d98f

See more details on using hashes here.

File details

Details for the file source2rss_client-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for source2rss_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cecfb2585edca160cdc61eb1d1f2192f773d0a982a22a4ca7620ec68f2a450bb
MD5 cb2e1233d93875320d7e04b0ec0a5705
BLAKE2b-256 cfe960756d19cb9713681c259217a0a2c3dfa5b2eab775651d4283c760b4d121

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