Mocean Client Library for Python
Project description
MoceanAPI Client Library for Python
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for moceansdk-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2b12c56f534195c4961ba41c29ea0683d5fcde593ffd2cc253f18690c450009 |
|
MD5 | 265197676aa038ae9a3a35ec23d686f3 |
|
BLAKE2b-256 | 010d5d50ddc666efa562639e1fa512f23adcaf40d9de3dd9a358e9d861587ec4 |