企业微信接口封装库
Project description
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、简化了接口调用操作
"""
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
work-weixin-api-0.0.2.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for work_weixin_api-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86762d6626b2b7aaa2542aedada1e27735a87d07a2129a8c40ddf4d9ff2066b5 |
|
MD5 | 18fbcbd6b41cc2cd183f1d6c5b24d868 |
|
BLAKE2b-256 | 75e099606d67bd9653e54916175da8572c02d8f70ad035212c46a2ee2c82ecc2 |