{"id":13625887,"url":"https://github.com/sbzhu/weworkapi_python","last_synced_at":"2025-04-16T10:33:31.232Z","repository":{"id":50456782,"uuid":"122746536","full_name":"sbzhu/weworkapi_python","owner":"sbzhu","description":"official lib of wework api https://work.weixin.qq.com/api/doc","archived":false,"fork":false,"pushed_at":"2023-03-01T00:16:03.000Z","size":54,"stargazers_count":495,"open_issues_count":17,"forks_count":329,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-10-02T00:39:14.179Z","etag":null,"topics":["api","python","wework"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbzhu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-24T14:17:18.000Z","updated_at":"2024-09-25T06:12:16.000Z","dependencies_parsed_at":"2024-01-14T07:11:24.796Z","dependency_job_id":"0905c6a6-17d6-401a-bf59-51a9cad35f08","html_url":"https://github.com/sbzhu/weworkapi_python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbzhu%2Fweworkapi_python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbzhu%2Fweworkapi_python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbzhu%2Fweworkapi_python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbzhu%2Fweworkapi_python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbzhu","download_url":"https://codeload.github.com/sbzhu/weworkapi_python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223708412,"owners_count":17189772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","python","wework"],"created_at":"2024-08-01T21:02:04.628Z","updated_at":"2024-11-08T15:30:41.598Z","avatar_url":"https://github.com/sbzhu.png","language":"Python","readme":"\n# About\nweworkapi_python 是为了简化开发者对企业微信API接口的使用而设计的，API调用库系列之python版本      \n本库仅做示范用，并不保证完全无bug；  \n作者会不定期更新本库，但不保证与官方API接口文档同步，因此一切以[官方文档](https://work.weixin.qq.com/api/doc)为准。\n\n更多来自个人开发者的其它语言的库推荐：  \npython : https://github.com/sbzhu/weworkapi_python  abelzhu@tencent.com(企业微信团队)  \nruby ： https://github.com/mycolorway/wework  MyColorway(个人开发者)  \nphp : https://github.com/sbzhu/weworkapi_php  abelzhu@tencent.com(企业微信团队)  \ngolang : https://github.com/sbzhu/weworkapi_golang  ryanjelin@tencent.com(企业微信团队)   \ngolang : https://github.com/doubliekill/EnterpriseWechatSDK  1006401052yh@gmail.com(个人开发者)  \n\n# Director \n\n├── api // API 接口  \n│   ├── examples // API接口的测试用例  \n│   ├── README.md  \n│   └── src // API接口的关键逻辑  \n├── conf.py  \n├── README.md  \n\n# Usage\n将本项目下载到你的目录，既可直接引用相关文件  \n详细使用方法参考examples路径下的测试用例\n\n# 关于token的缓存\ntoken是需要缓存的，不能每次调用都去获取token，[否则会中频率限制](https://work.weixin.qq.com/api/doc#10013/%E7%AC%AC%E5%9B%9B%E6%AD%A5%EF%BC%9A%E7%BC%93%E5%AD%98%E5%92%8C%E5%88%B7%E6%96%B0access_token)  \n在本库的设计里，token是以类里的一个变量缓存的  \n比如api/src/CorpApi.py 里的access_token变量  \n在类的生命周期里，这个accessToken都是存在的， 当且仅当发现token过期，CorpAPI类会自动刷新token   \n刷新机制在 api/src/AbstractApi.py  \n所以，使用时，只需要全局实例化一个CorpAPI类，不要析构它，就可一直用它调函数，不用关心 token  \n```\napi = CorpAPI(corpid, corpsecret);\napi.dosomething()\napi.dosomething()\napi.dosomething()\n....\n```\n当然，如果要更严格的做的话，建议自行修改，全局缓存token，比如存redis、存文件等，失效周期设置为2小时。\n\n# Contact us\nabelzhu@tencent.com  \n\n# \n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbzhu%2Fweworkapi_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbzhu%2Fweworkapi_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbzhu%2Fweworkapi_python/lists"}