Python:企业微信接口封装库work-weixin-api
2023-09-14 09:07:13 时间
Work Weixin Api
企业微信接口封装库
Github: https://github.com/mouday/work-weixin-api
目前实现了简单的发送消息功能,后序按照业务继续增加其他接口
install
pip install work-weixin-api
demo
# -*- coding: utf-8 -*-
from work_weixin_api import WorkWeixinClient
class CustomWorkWeixinClient(WorkWeixinClient):
"""配置自己企业的信息"""
# 企业id
corpid = ""
# 秘钥
corpsecret = ""
# 应用id
agent_id = "100000"
if __name__ == '__main__':
client = CustomWorkWeixinClient()
print(client.user_simplelist(department_id=1))
# 发送消息
print(client.message_send(
agentid=client.agent_id,
msgtype="text",
msgdata={'content': 'hi'}, touser="PengShiYu"
))
说明
核心类继承关系:
class WorkWeixinApi(object):
"""
实现了最基础的企业微信接口函数
"""
class WorkWeixinClient(WorkWeixinApi):
"""
扩展了基本的接口函数
1、对access_token 进行了缓存
2、简化了接口调用操作
"""
相关文章
- Python怎么输入小数和整数_python输入非负整数
- python进制转换函数-Python中进制转换函数的使用
- python爬虫—–Python访问http的几种方式「建议收藏」
- Python 生成随机数_python建立随机数列表
- python设置时间过期改变状态_Python Redis设置过期时间「建议收藏」
- Python win32api_python api文档
- Python 怎么捕获警告?(注意:不是捕获异常)
- freemaker判断空_python条件语句举例
- python自动化测试—Python自动化框架及工具
- Python 接口测试之接口请求方法封装
- Python基础之logging日志模块封装
- Anaconda和Python是什么关系?
- python实现堆(最大堆、最小堆、最小最大堆)
- Python 接口测试之获取接口数据封装
- Python 接口测试之Excel表格数据操作方法封装
- python-Python与SQLite数据库-SQLite数据库的基本知识(二)
- python-Python与SQLite数据库-处理SQLite查询结果(二)
- python连接Oracle数据库的代码详解编程语言
- python中的虚函数详解编程语言
- python学习 正则表达式详解编程语言
- Python输出函数print()总结(python print())详解编程语言
- Python轻松连接SQL Server数据库(python连接sqlserver)
- 如何在Linux上将Python脚本设置为后台运行?(linux后台运行python)
- 从 Python 连接到 MySQL:实现更多强大的数据库应用(python和mysql)
- Python操作MySQL数据库的必备模块mysqlpython(mysql_python)
- 用python实现的可以拷贝或剪切一个文件列表中的所有文件
- Python中实现字符串类型与字典类型相互转换的方法