Skip to content

MoceanAPI/mocean-sdk-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MoceanAPI Client Library for Python

Latest Stable Version Github Build Status codecov codacy license

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.

Installation

To use the client library you'll need to have created a Mocean account.

Install from PyPi using pip, a package manager for Python.

pip install moceansdk

Usage

Create a client with your API key and secret:

from moceansdk import Client, Basic

credential = Basic("API_KEY_HERE", "API_SECRET_HERE")
mocean = Client(credential)

Example

To use Mocean's SMS API 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.

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 package.

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 for more usage

License

This library is released under the MIT License

About

✉📲 SDK Library for Python to send SMS for FREE using MoceanAPI sms solution.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 7

Languages