python-huawei-push-admin


Namepython-huawei-push-admin JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/TralahM/python_huawei_push_admin
SummaryThe Huawei Admin Python SDK enables server-side (backend) Python developers to integrate Huawei into their services and applications.
upload_time2022-12-10 05:30:15
maintainer
docs_urlNone
authorTralah M Brian
requires_python
licenseAPACHE
keywords
VCS
bugtrack_url
requirements requests six
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## HMS PushKit Python Severdemo
English | [中文](https://gitee.com/hms-core/hms-push-serverdemo-python/blob/master/python37/README_ZH.md)

## Table of Contents

 * [Introduction](#introduction)
 * [Installation](#installation)
 * [Configuration ](#configuration )
 * [Supported Environments](#supported-environments)
 * [Sample Code](#sample-code)
 * [Libraries](#Libraries)
 * [License](#license)
 
 
## Introduction

Python sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs about quick access to HUAWEI Push Kit for your reference or usage.

The following table describes packages of Python sample code.

| Package      |    Description |
| ----------   |    ------------|
| examples     |    Sample code packages. Each package can run independently.|
| push_admin   |    Package where APIs of the HUAWEI Push Kit server are encapsulated.|
	
## Installation

To install pushkit-python-sample, you should extract the compressed ZIP file, execute the following command in the unzipped directory:
```
python setup.py install
```

## Supported Environments
For pushkit-python-sample, We currently support Python 2.7/3.7 and JetBrains PyCharm are recommended.


## Configuration 
The following table describes parameters of the initialize_app method.

| Parameter      |    Description |
| -------------  |   ------------------------------------------------------------------------- |
| appid          |    App ID, which is obtained from app information. |
| appsecret      |    Secret access key of an app, which is obtained from app information. |
| token_server   |    URL for the Huawei OAuth 2.0 service to obtain a token, please refer to [Generating an App-Level Access Token](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/oauth2-0000001212610981). |
| push_open_url  |    URL for accessing HUAWEI Push Kit, please refer to [Sending Messages](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-server-dev-0000001050040110?ha_source=hms1).||


## Sample Code

Python sample code uses the Messaging structure in the push_admin package as the entry. Each method in the Messaging 
structure calls an API of the HUAWEI Push Kit server.

The following table describes methods in the Messaging structure.

| Method              |     Description
| -----------------   |     --------------------------------------------------- |
| send_message        |     Sends a message to a device. |
| subscribe_topic     |     Subscribes to a topic. |
| unsubscribe_topic   |     Unsubscribes from a topic. |
| list_topics         |     Queries the list of topics subscribed by a device. |
| initialize_app      |     Initializes the configuration parameters. |


1) Send an Android data message.
Code location: examples/send_data_message.py

2) Send an Android notification message.
Code location: examples/send_notify_message.py

3) Send a message by topic.
Code location: examples/send_topic_message.py

4) Send a message by conditions.
Code location: examples/send_condition_message.py

5) Send a message to a Huawei quick app.
Code location: examples/send_instance_app_message.py

6) Send a message through the WebPush agent.
Code location: examples/send_webpush_message.py

7) Send a message through the APNs agent.
Code location: examples/send_apns_message.py

8) Send a test message.
Code location: examples/send_test_message.py

## Libraries
| Library             |     Site
| -----------------   |     --------------------------------------------------- |
| requests            |     https://requests.readthedocs.io/en/master/ |
| six                 |     https://six.readthedocs.io/   |
## License

pushkit Python sample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TralahM/python_huawei_push_admin",
    "name": "python-huawei-push-admin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Tralah M Brian",
    "author_email": "briantralah@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "## HMS PushKit Python Severdemo\nEnglish | [\u4e2d\u6587](https://gitee.com/hms-core/hms-push-serverdemo-python/blob/master/python37/README_ZH.md)\n\n## Table of Contents\n\n * [Introduction](#introduction)\n * [Installation](#installation)\n * [Configuration ](#configuration )\n * [Supported Environments](#supported-environments)\n * [Sample Code](#sample-code)\n * [Libraries](#Libraries)\n * [License](#license)\n \n \n## Introduction\n\nPython sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs about quick access to HUAWEI Push Kit for your reference or usage.\n\nThe following table describes packages of Python sample code.\n\n| Package      |    Description |\n| ----------   |    ------------|\n| examples     |    Sample code packages. Each package can run independently.|\n| push_admin   |    Package where APIs of the HUAWEI Push Kit server are encapsulated.|\n\t\n## Installation\n\nTo install pushkit-python-sample, you should extract the compressed ZIP file, execute the following command in the unzipped directory:\n```\npython setup.py install\n```\n\n## Supported Environments\nFor pushkit-python-sample, We currently support Python 2.7/3.7 and JetBrains PyCharm are recommended.\n\n\n## Configuration \nThe following table describes parameters of the initialize_app method.\n\n| Parameter      |    Description |\n| -------------  |   ------------------------------------------------------------------------- |\n| appid          |    App ID, which is obtained from app information. |\n| appsecret      |    Secret access key of an app, which is obtained from app information. |\n| token_server   |    URL for the Huawei OAuth 2.0 service to obtain a token, please refer to [Generating an App-Level Access Token](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/oauth2-0000001212610981). |\n| push_open_url  |    URL for accessing HUAWEI Push Kit, please refer to [Sending Messages](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-server-dev-0000001050040110?ha_source=hms1).||\n\n\n## Sample Code\n\nPython sample code uses the Messaging structure in the push_admin package as the entry. Each method in the Messaging \nstructure calls an API of the HUAWEI Push Kit server.\n\nThe following table describes methods in the Messaging structure.\n\n| Method              |     Description\n| -----------------   |     --------------------------------------------------- |\n| send_message        |     Sends a message to a device. |\n| subscribe_topic     |     Subscribes to a topic. |\n| unsubscribe_topic   |     Unsubscribes from a topic. |\n| list_topics         |     Queries the list of topics subscribed by a device. |\n| initialize_app      |     Initializes the configuration parameters. |\n\n\n1) Send an Android data message.\nCode location: examples/send_data_message.py\n\n2) Send an Android notification message.\nCode location: examples/send_notify_message.py\n\n3) Send a message by topic.\nCode location: examples/send_topic_message.py\n\n4) Send a message by conditions.\nCode location: examples/send_condition_message.py\n\n5) Send a message to a Huawei quick app.\nCode location: examples/send_instance_app_message.py\n\n6) Send a message through the WebPush agent.\nCode location: examples/send_webpush_message.py\n\n7) Send a message through the APNs agent.\nCode location: examples/send_apns_message.py\n\n8) Send a test message.\nCode location: examples/send_test_message.py\n\n## Libraries\n| Library             |     Site\n| -----------------   |     --------------------------------------------------- |\n| requests            |     https://requests.readthedocs.io/en/master/ |\n| six                 |     https://six.readthedocs.io/   |\n## License\n\npushkit Python sample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n",
    "bugtrack_url": null,
    "license": "APACHE",
    "summary": "The Huawei Admin Python SDK enables server-side (backend) Python developers to integrate Huawei into their services and applications.",
    "version": "1.0.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "c22b1602221e7d11e6a042bc32682b0e",
                "sha256": "e82dce87e9a94f36ebc15db336e86b69e4699be548b9142656b926ec63895b31"
            },
            "downloads": -1,
            "filename": "python_huawei_push_admin-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c22b1602221e7d11e6a042bc32682b0e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 24916,
            "upload_time": "2022-12-10T05:30:15",
            "upload_time_iso_8601": "2022-12-10T05:30:15.936860Z",
            "url": "https://files.pythonhosted.org/packages/44/7b/d4f5dc46f52574121a7e2d2ba17335c5f16b813be36c412307b3505235fa/python_huawei_push_admin-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-10 05:30:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "TralahM",
    "github_project": "python_huawei_push_admin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.20.1"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    ">=",
                    "1.14.0"
                ]
            ]
        }
    ],
    "lcname": "python-huawei-push-admin"
}
        
Elapsed time: 0.01682s