https://github.com/moceanapi/mocean-sdk-python
✉📲 SDK Library for Python to send SMS for FREE using MoceanAPI sms solution.
https://github.com/moceanapi/mocean-sdk-python
moceanapi python sms sms-api sms-client sms-messages
Last synced: 5 months ago
JSON representation
✉📲 SDK Library for Python to send SMS for FREE using MoceanAPI sms solution.
- Host: GitHub
- URL: https://github.com/moceanapi/mocean-sdk-python
- Owner: MoceanAPI
- License: mit
- Created: 2018-06-27T03:56:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-12-18T05:57:05.000Z (about 1 year ago)
- Last Synced: 2025-07-02T12:07:31.912Z (6 months ago)
- Topics: moceanapi, python, sms, sms-api, sms-client, sms-messages
- Language: Python
- Homepage: https://moceanapi.com/
- Size: 183 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
MoceanAPI Client Library for Python
============================
[](https://pypi.org/project/moceansdk/)
[](https://github.com/MoceanAPI/mocean-sdk-python/actions/workflows/build.yml)
[](https://codecov.io/gh/MoceanAPI/mocean-sdk-python)
[](https://app.codacy.com/project/MoceanAPI/mocean-sdk-python/dashboard)
[](https://pypi.org/project/moceansdk/)
This is the Python client library for use Mocean's API. To use this, you'll need a Mocean account. Sign up [for free at
moceanapi.com][signup].
* [Installation](#installation)
* [Usage](#usage)
* [Examples](#examples)
## Installation
To use the client library you'll need to have [created a Mocean account][signup].
Install from PyPi using pip, a package manager for Python.
```bash
pip install moceansdk
```
## Usage
Create a client with your API key and secret:
```python
from moceansdk import Client, Basic
credential = Basic("API_KEY_HERE", "API_SECRET_HERE")
mocean = Client(credential)
```
## Example
To use [Mocean's SMS API][doc_sms] to send an SMS message, call the `mocean.sms.send()` method.
The API can be called directly, using a simple array of parameters, the keys match the [parameters of the API][doc_sms].
```python
res = mocean.sms.send({
"mocean-from": "MOCEAN",
"mocean-to": 60123456789,
"mocean-text": "Hello World"
})
print(res)
```
### Responses
For your convenient, the API response has been parsed to `dict` using [dotmap](https://github.com/drgrib/dotmap) package.
```python
print(res) # show full response string
print(res.status) # show response status, '0' in this case
print(res['status']) # same as above
```
## Documentation
Kindly visit [MoceanApi Docs][doc_main] for more usage
License
-------
This library is released under the [MIT License][license]
[signup]: https://dashboard.moceanapi.com/register?medium=github&campaign=python-sdk
[doc_main]: https://moceanapi.com/docs/?python
[doc_sms]: https://moceanapi.com/docs/?python#send-sms
[license]: LICENSE.txt