All Projects → youfou → Wxpy

youfou / Wxpy

Licence: other
微信机器人 / 可能是最优雅的微信个人号 API ✨✨

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Wxpy

Mojo Weixin
使用Perl语言(不会没关系)编写的个人账号微信/weixin/wechat客户端框架(非GUI),可通过插件提供基于HTTP协议的api接口供其他语言或系统调用
Stars: ✭ 1,181 (-90.96%)
Mutual labels:  api, wechat, weixin
Weixin Spider
微信公众号爬虫,公众号历史文章,文章评论,文章阅读及在看数据,可视化web页面,可部署于Windows服务器。基于Python3之flask/mysql/redis/mitmproxy/pywin32等实现,高效微信爬虫,微信公众号爬虫,历史文章,文章评论,数据更新。
Stars: ✭ 287 (-97.8%)
Mutual labels:  api, wechat, weixin
Wechatvideocourse
《微信公众号+小程序快速开发》视频教程课件及代码
Stars: ✭ 185 (-98.58%)
Mutual labels:  api, wechat
Typescript Wxapi.d.ts
🦉微信小程序typescript的声明文件
Stars: ✭ 133 (-98.98%)
Mutual labels:  wechat, weixin
Wechat Proxy
微信代理服务。提供简单易用的 HTTP 接口,简化微信公众号后台开发。
Stars: ✭ 151 (-98.84%)
Mutual labels:  wechat, weixin
Elastalert Wechat Plugin
elastalert微信企业号报警插件
Stars: ✭ 112 (-99.14%)
Mutual labels:  wechat, weixin
Wechatpay Postman Script
微信支付API v3的调试工具
Stars: ✭ 112 (-99.14%)
Mutual labels:  api, wechat
Wechat Django
WeChat-Django旨在为接入微信公众平台的django开发者提供便捷的微信功能封装及最基本的后台管理支持
Stars: ✭ 143 (-98.9%)
Mutual labels:  wechat, weixin
Ggbot
一个用Go写的微信机器人
Stars: ✭ 103 (-99.21%)
Mutual labels:  wechat, weixin
Crmeb wechatminiprogram
CRMEBv2.6以客户管理为中心+电商营销系统,微信小程序商城,带分销、秒杀、积分、优惠券等功能
Stars: ✭ 158 (-98.79%)
Mutual labels:  wechat, weixin
Cleanupwechatzombiefans
auto.js脚本,Android自动化,清理微信僵尸粉
Stars: ✭ 155 (-98.81%)
Mutual labels:  wechat, weixin
Weixin Java Cp Demo
基于Spring Boot 和 WxJava 实现的微信企业号/企业微信 后端Demo
Stars: ✭ 175 (-98.66%)
Mutual labels:  wechat, weixin
Wechat Toolbox
WeChat toolbox(微信工具箱)
Stars: ✭ 109 (-99.17%)
Mutual labels:  wechat, weixin
Wechat
java微信客户端
Stars: ✭ 109 (-99.17%)
Mutual labels:  wechat, weixin
Wx Miniprogram Boilerplate
基于Gulp微信小程序开发工作流,支持less样式编写,支持ESLint代码检查等功能
Stars: ✭ 122 (-99.07%)
Mutual labels:  wechat, weixin
Rageframe2
一个基于Yii2高级框架的快速开发应用引擎
Stars: ✭ 1,553 (-88.11%)
Mutual labels:  api, wechat
Wxread Webautoreader
微信读书自动阅读器,全自动刷阅读时长,轻轻松松冲顶霸榜,您的微读挂机好帮手
Stars: ✭ 138 (-98.94%)
Mutual labels:  wechat, weixin
Go Workwx
a sensible Work Weixin(企业微信, Wechat Work) SDK for Go
Stars: ✭ 181 (-98.61%)
Mutual labels:  wechat, weixin
Wechatswift
iOS WeChat App Written in Swift 5.0
Stars: ✭ 102 (-99.22%)
Mutual labels:  wechat, weixin
Wechat Go
go version wechat web api and message framework for building wechat robot
Stars: ✭ 1,381 (-89.42%)
Mutual labels:  api, wechat

wxpy: 用 Python 玩微信

https://readthedocs.org/projects/wxpy/badge/?version=latest
微信机器人 / 可能是最优雅的微信个人号 API
wxpy 在 itchat 的基础上,通过大量接口优化提升了模块的易用性,并进行丰富的功能扩展

Attention!

强烈建议仅使用小号运行机器人!
从近期 (17年6月下旬) 反馈来看,使用机器人存在一定概率被限制登录的可能性。
主要表现为无法登陆 Web 微信 (但不影响手机等其他平台)。

用来干啥

一些常见的场景

  • 控制路由器、智能家居等具有开放接口的玩意儿
  • 运行脚本时自动把日志发送到你的微信
  • 加群主为好友,自动拉进群中
  • 跨号或跨群转发消息
  • 自动陪人聊天
  • 逗人玩
  • ...

总而言之,可用来实现各种微信个人号的自动化操作

轻松安装

wxpy 支持 Python 3.4-3.6,以及 2.7 版本

将下方命令中的 "pip" 替换为 "pip3" 或 "pip2",可确保安装到对应的 Python 版本中

  1. 从 PYPI 官方源下载安装 (在国内可能比较慢或不稳定):
pip install -U wxpy
  1. 从豆瓣 PYPI 镜像源下载安装 (推荐国内用户选用):
pip install -U wxpy -i "https://pypi.doubanio.com/simple/"

简单上手

登陆微信:

# 导入模块
from wxpy import *
# 初始化机器人,扫码登陆
bot = Bot()

找到好友:

# 搜索名称含有 "游否" 的男性深圳好友
my_friend = bot.friends().search('游否', sex=MALE, city="深圳")[0]

发送消息:

# 发送文本给好友
my_friend.send('Hello WeChat!')
# 发送图片
my_friend.send_image('my_picture.jpg')

自动响应各类消息:

# 打印来自其他好友、群聊和公众号的消息
@bot.register()
def print_others(msg):
    print(msg)

# 回复 my_friend 的消息 (优先匹配后注册的函数!)
@bot.register(my_friend)
def reply_my_friend(msg):
    return 'received: {} ({})'.format(msg.text, msg.type)

# 自动接受新的好友请求
@bot.register(msg_types=FRIENDS)
def auto_accept_friends(msg):
    # 接受好友请求
    new_friend = msg.card.accept()
    # 向新的好友发送消息
    new_friend.send('哈哈,我自动接受了你的好友请求')

保持登陆/运行:

# 进入 Python 命令行、让程序保持运行
embed()

# 或者仅仅堵塞线程
# bot.join()

模块特色

  • 全面对象化接口,调用更优雅

  • 默认多线程响应消息,回复更快

  • 包含 聊天机器人、共同好友 等 实用组件

  • 只需两行代码,在其他项目中用微信接收警告

  • 愉快的探索和调试,无需涂涂改改

  • 可混合使用 itchat 的原接口

  • 当然,还覆盖了各类常见基本功能:

    • 发送文本、图片、视频、文件
    • 通过关键词或用户属性搜索 好友、群聊、群成员等
    • 获取好友/群成员的昵称、备注、性别、地区等信息
    • 加好友,建群,邀请入群,移出群

说明文档

http://wxpy.readthedocs.io

更新日志

https://github.com/youfou/wxpy/releases

项目主页

https://github.com/youfou/wxpy

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].