{"id":20732387,"url":"https://github.com/jpush/jpush-api-python-client","last_synced_at":"2025-04-04T22:06:55.885Z","repository":{"id":11110855,"uuid":"13466926","full_name":"jpush/jpush-api-python-client","owner":"jpush","description":"JPush's officially supported Python client library for accessing JPush APIs.   极光推送官方支持的 Python 版本服务器端 SDK。","archived":false,"fork":false,"pushed_at":"2022-02-18T03:57:37.000Z","size":195,"stargazers_count":209,"open_issues_count":5,"forks_count":87,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-03-28T21:06:26.199Z","etag":null,"topics":["jpush","python","sdk"],"latest_commit_sha":null,"homepage":"https://docs.jiguang.cn","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/jpush.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-10T09:16:26.000Z","updated_at":"2025-03-17T15:51:19.000Z","dependencies_parsed_at":"2022-08-07T06:01:08.513Z","dependency_job_id":null,"html_url":"https://github.com/jpush/jpush-api-python-client","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-api-python-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-api-python-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-api-python-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-api-python-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpush","download_url":"https://codeload.github.com/jpush/jpush-api-python-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256112,"owners_count":20909240,"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":["jpush","python","sdk"],"created_at":"2024-11-17T05:19:09.984Z","updated_at":"2025-04-04T22:06:55.862Z","avatar_url":"https://github.com/jpush.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JPush API Python Client\n\n## 概述\n这是 JPush REST API 的 Python 版本封装开发包，是由极光推送官方提供的，一般支持最新的 API 功能。\n\n对应的 REST API 文档：\u003chttps://docs.jiguang.cn/jpush/server/push/server_overview/\u003e\n\n## 兼容版本\n+  Python 2.7\n+  Python 3\n\n## 环境配置\n\npip 方式：\n```\nsudo pip install jpush\n```\neasy_install 方式：\n```\nsudo easy_install jpush\n```\n使用源码方式：\n```\nsudo python setup.py install\n```\n\n\n## 代码样例\n\n\u003e   代码样例在 jpush-api-python-client 中的 examples 文件夹中，[点击查看所有 examples ](https://github.com/jpush/jpush-api-python-client/tree/master/examples) 。\n\n\u003e   以下片断来自项目代码里的文件：jpush-api-python-client 中的 examples/push_examples  目录下的 example_all.py\n\n\u003e   这个样例演示了消息推送，日志设置，异常处理。\n\n```\n_jpush = jpush.JPush(app_key, master_secret)\npush = _jpush.create_push()\n# if you set the logging level to \"DEBUG\",it will show the debug logging.\n_jpush.set_logging(\"DEBUG\")\npush.audience = jpush.all_\npush.notification = jpush.notification(alert=\"hello python jpush api\")\npush.platform = jpush.all_\ntry:\n    response=push.send()\nexcept common.Unauthorized:\n    raise common.Unauthorized(\"Unauthorized\")\nexcept common.APIConnectionException:\n    raise common.APIConnectionException(\"conn error\")\nexcept common.JPushFailure:\n    print (\"JPushFailure\")\nexcept:\n    print (\"Exception\")\n```\n## 日志说明\nlogging level 默认的是 WARNING ，为了方便调试建议设置为 DEBUG\n设置方法为：\n```\n_jpush.set_logging(\"DEBUG\")\n```\n\n## 异常说明\n\n+ Unauthorized\n    + AppKey，Master Secret 错误，验证失败必须改正。\n\n+ APIConnectionException\n    + 包含错误的信息：比如超时，无网络等情况。\n\n+ JPushFailure\n    + 请求出错，参考业务返回码。\n\n## HTTP 状态码\n\n参考文档：\u003chttp://docs.jiguang.cn/jpush/server/push/http_status_code/\u003e\n\nPush v3 API 状态码 参考文档：\u003chttp://docs.jiguang.cn/jpush/server/push/rest_api_v3_push/\u003e　\n\nReport API  状态码 参考文档：\u003chttp://docs.jiguang.cn/jpush/server/push/rest_api_v3_report/\u003e\n\nDevice API 状态码 参考文档：\u003chttp://docs.jiguang.cn/jpush/server/push/rest_api_v3_device/\u003e\n\nPush Schedule API 状态码 参考文档：\u003chttp://docs.jiguang.cn/jpush/server/push/rest_api_push_schedule/\u003e　\n\n[Release页面](https://github.com/jpush/jpush-api-python-client/releases) 有详细的版本发布记录与下载。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpush%2Fjpush-api-python-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpush%2Fjpush-api-python-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpush%2Fjpush-api-python-client/lists"}