informclient


Nameinformclient JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/moengage/inform-client-python
SummaryThis Python Package helps you in sending notifications through MoEngage Inform
upload_time2023-01-30 08:13:49
maintainer
docs_urlNone
authorMoEngage
requires_python>=3.9
license
keywords moengage inform moengage inform customer engagement transactional alerts
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # `informclient`

## Table of contents

- Overview
- Installation
- Requirements
- Usage
- Troubleshooting and FAQs
- APIs
- Contributing
- License

## Overview

This Python Package helps you in sending notifications through [MoEngage Inform](https://www.moengage.com/blog/introducing-transactional-alerts-moengage-inform/), the smartest way to design & deliver notifications. Deliver your transactional messages to any channel through one API. Currently Email and SMS channels are supported.
For an official overview of Inform Product, please see the [Inform Overview](https://help.moengage.com/hc/en-us/articles/10672957787284-Overview-Inform) or contact us at [MoEngage](https://moengage.com/). Happy engaging your users!

## Installation
Install from PyPI using [pip](http://www.pip-installer.org/en/latest/):

```shell
$ pip install informclient
```

python3.9 or later is required.

## Requirements
```text
  StrEnum~=0.4.9
  urllib3~=1.26.13
  jsonschema~=4.17.3
```
Note: Install these individually if any issue raises in installation of these requirements like this 
```shell
$ pip install StrEnum~=0.4.9
```

## Usage

```python
from informclient import InformClient
"""
base_url = "https://sandbox-inform-api-XX.moengage.com"
app_id = "XXXXXXXXXX"
api_secret = "XXXXXXXXXX"
"""
client = InformClient(base_url, app_id, api_secret)
payload = {
    "alert_id": "XXXXXXXXXX",
    "user_id": "XXXXXXXXXX",
    "transaction_id": "XXXXXXXXXX",
    "payloads": 
        {
            "SMS": 
                {
                    "recipient":"+91XXXXXXXXXX",
                    "personalized_attributes": {
                        "attr": "value"
                    }
                },
            "EMAIL":
                {
                    "recipient":"XXXXXXXXXX@example.com",
                    "personalized_attributes": {
                        "attr": "value"
                    }
                }
        }
}
response = client.send_alert(payload)
print(response)
```

## Troubleshooting and FAQs
- ### What is the format of base_url?
    - The base_url should be of the format "https://sandbox-inform-api-XX.moengage.com"
    
- ### Why do I get **sslcertverificationerror** while sending an alert? 
    - Inform Client is only supported through secured HTTPS connection requests. If the request throws
      **sslcertverificationerror**. Run the following commands.
        - For **MacOSx**
            ```shell
            $ pip install certifi
            $ /Applications/Python\ 3.9/Install\ Certificates.command
            ```
        - For **Windows**
            ```shell
            $ pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org informclient
            ```
 

## APIs

For a full description of request and response payloads and properties, please see the [Official Inform API docs](https://developers.moengage.com/hc/en-us/articles/10699624590868).

- `send_alert(requestbody) (response, Error)` [[See alert Description ]](https://help.moengage.com/hc/en-us/articles/10717041310484-Test-Alert#attributes-0-5)

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/moengage/inform-client-python. See [CONTRIBUTING.md](CONTRIBUTING.md) for more info.

## License

This package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
MIT LICENSE

Copyright 2023 MOENGAGE

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/moengage/inform-client-python",
    "name": "informclient",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "MoEngage,Inform,MoEngage Inform,Customer Engagement,Transactional Alerts",
    "author": "MoEngage",
    "author_email": "inform@moengage.com",
    "download_url": "https://files.pythonhosted.org/packages/b9/a4/64ebd21216abad6d96f5501efdf68fb369ed73e213976c7db1a53c7fd4ae/informclient-0.0.1.tar.gz",
    "platform": null,
    "description": "# `informclient`\n\n## Table of contents\n\n- Overview\n- Installation\n- Requirements\n- Usage\n- Troubleshooting and FAQs\n- APIs\n- Contributing\n- License\n\n## Overview\n\nThis Python Package helps you in sending notifications through [MoEngage Inform](https://www.moengage.com/blog/introducing-transactional-alerts-moengage-inform/), the smartest way to design & deliver notifications. Deliver your transactional messages to any channel through one API. Currently Email and SMS channels are supported.\nFor an official overview of Inform Product, please see the [Inform Overview](https://help.moengage.com/hc/en-us/articles/10672957787284-Overview-Inform) or contact us at [MoEngage](https://moengage.com/). Happy engaging your users!\n\n## Installation\nInstall from PyPI using [pip](http://www.pip-installer.org/en/latest/):\n\n```shell\n$ pip install informclient\n```\n\npython3.9 or later is required.\n\n## Requirements\n```text\n  StrEnum~=0.4.9\n  urllib3~=1.26.13\n  jsonschema~=4.17.3\n```\nNote: Install these individually if any issue raises in installation of these requirements like this \n```shell\n$ pip install StrEnum~=0.4.9\n```\n\n## Usage\n\n```python\nfrom informclient import InformClient\n\"\"\"\nbase_url = \"https://sandbox-inform-api-XX.moengage.com\"\napp_id = \"XXXXXXXXXX\"\napi_secret = \"XXXXXXXXXX\"\n\"\"\"\nclient = InformClient(base_url, app_id, api_secret)\npayload = {\n    \"alert_id\": \"XXXXXXXXXX\",\n    \"user_id\": \"XXXXXXXXXX\",\n    \"transaction_id\": \"XXXXXXXXXX\",\n    \"payloads\": \n        {\n            \"SMS\": \n                {\n                    \"recipient\":\"+91XXXXXXXXXX\",\n                    \"personalized_attributes\": {\n                        \"attr\": \"value\"\n                    }\n                },\n            \"EMAIL\":\n                {\n                    \"recipient\":\"XXXXXXXXXX@example.com\",\n                    \"personalized_attributes\": {\n                        \"attr\": \"value\"\n                    }\n                }\n        }\n}\nresponse = client.send_alert(payload)\nprint(response)\n```\n\n## Troubleshooting and FAQs\n- ### What is the format of base_url?\n    - The base_url should be of the format \"https://sandbox-inform-api-XX.moengage.com\"\n    \n- ### Why do I get **sslcertverificationerror** while sending an alert? \n    - Inform Client is only supported through secured HTTPS connection requests. If the request throws\n      **sslcertverificationerror**. Run the following commands.\n        - For **MacOSx**\n            ```shell\n            $ pip install certifi\n            $ /Applications/Python\\ 3.9/Install\\ Certificates.command\n            ```\n        - For **Windows**\n            ```shell\n            $ pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org informclient\n            ```\n \n\n## APIs\n\nFor a full description of request and response payloads and properties, please see the [Official Inform API docs](https://developers.moengage.com/hc/en-us/articles/10699624590868).\n\n- `send_alert(requestbody) (response, Error)` [[See alert Description ]](https://help.moengage.com/hc/en-us/articles/10717041310484-Test-Alert#attributes-0-5)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/moengage/inform-client-python. See [CONTRIBUTING.md](CONTRIBUTING.md) for more info.\n\n## License\n\nThis package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\nMIT LICENSE\n\nCopyright 2023 MOENGAGE\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "This Python Package helps you in sending notifications through MoEngage Inform",
    "version": "0.0.1",
    "split_keywords": [
        "moengage",
        "inform",
        "moengage inform",
        "customer engagement",
        "transactional alerts"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bba40da19255b466d74b6f377e83f7d787ed774ab3fb4f20d3c9559def61dbcd",
                "md5": "f7d1adee5f16871e9b488470132ce622",
                "sha256": "48bf168d8d98563db862576baf17f37d7e2bdfdde0dabbec80481ce62e37479c"
            },
            "downloads": -1,
            "filename": "informclient-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f7d1adee5f16871e9b488470132ce622",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6651,
            "upload_time": "2023-01-30T08:13:47",
            "upload_time_iso_8601": "2023-01-30T08:13:47.561953Z",
            "url": "https://files.pythonhosted.org/packages/bb/a4/0da19255b466d74b6f377e83f7d787ed774ab3fb4f20d3c9559def61dbcd/informclient-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9a464ebd21216abad6d96f5501efdf68fb369ed73e213976c7db1a53c7fd4ae",
                "md5": "c61b70057748825c040f0ebd45a5a363",
                "sha256": "437458ca6a5df3ff79b931d473f28b731aa346ae5ed97f1a8129153b4787884c"
            },
            "downloads": -1,
            "filename": "informclient-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c61b70057748825c040f0ebd45a5a363",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5886,
            "upload_time": "2023-01-30T08:13:49",
            "upload_time_iso_8601": "2023-01-30T08:13:49.883578Z",
            "url": "https://files.pythonhosted.org/packages/b9/a4/64ebd21216abad6d96f5501efdf68fb369ed73e213976c7db1a53c7fd4ae/informclient-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-30 08:13:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "moengage",
    "github_project": "inform-client-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "informclient"
}
        
Elapsed time: 0.03923s