Wechat_Sender
随时随地发送消息到微信
简介
wechat_sender 是基于 wxpy 和 tornado 实现的一个可以将你的网站、爬虫、脚本等其他应用中各种消息 (日志、报警、运行结果等) 发送到微信的工具
初衷
wxpy 基于 itchat 提供了较为完备的微信个人号 API ,而我想使用个人微信来接收我的网站的报警信息以及一些爬虫的结果,因此我写了这个工具。
安装
pip install wechat_sender
运行环境
Python 2.7 及以上 Python 3 及以上
使用
登录微信并启动 wechat_sender 服务.
from wxpy import *
from wechat_sender import *
bot = Bot()
listen(bot)
# 之后 wechat_sender 将持续运行等待接收外部消息
在外部向微信发送消息.
from wechat_sender import Sender
Sender().send('Hello From Wechat Sender')
# Hello From Wechat Sender 这条消息将通过 1 中登录微信的文件助手发送给你
如果你是 wxpy 的使用者,只需更改一句即可使用 wechat_sender:
例如这是你本来的代码:
# coding: utf-8
from __future__ import unicode_literals
from wxpy import *
bot = Bot('bot.pkl')
my_friend = bot.friends().search('xxx')[0]
my_friend.send('Hello WeChat!')
@bot.register(Friend)
def reply_test(msg):
msg.reply('test')
bot.join()
使用 wechat_sender:
# coding: utf-8
from __future__ import unicode_literals
from wxpy import *
from wechat_sender import listen
bot = Bot('bot.pkl')
my_friend = bot.friends().search('xxx')[0]
my_friend.send('Hello WeChat!')
@bot.register(Friend)
def reply_test(msg):
msg.reply('test')
listen(bot) # 只需改变最后一行代码
之后如果你想在其他程序或脚本中向微信发消息,只需要:
# coding: utf-8
from wechat_sender import Sender
Sender().send("Hello From Wechat Sender")
交流
扫描二维码,验证信息输入 ‘wechat_sender’ 或 ‘加群’ 进入微信交流群
Metadata
Release files for wechat-sender 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wechat_sender-0.1.4.tar.gz | 11.0 kB | Without provenance | Details for wechat_sender-0.1.4.tar.gz |
Release files / wechat_sender-0.1.4.tar.gz
| Download URL | wechat_sender-0.1.4.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf8941bb313c833f16e372edb49c0db3a13894ef5acaa59405d2d5a3d79b21dd
|
|
BLAKE2b-256 checksum How to use checksums |
762e1ef70dedf799f0259d9848c67af7034fde8ca70421a14e077bee133f1460
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for wechat-sender 0.1.4
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.