Skip to main content

Mocean Client Library for Python

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moceansdk-1.1.4.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

moceansdk-1.1.4-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file moceansdk-1.1.4.tar.gz.

File metadata

  • Download URL: moceansdk-1.1.4.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for moceansdk-1.1.4.tar.gz
Algorithm Hash digest
SHA256 d1b214c4e8656460850d20ef5fb5d2d800d2fa3b5d538f732b683be378aba8a2
MD5 867c4682b3fc268500506987d28ac80c
BLAKE2b-256 8abfc0b1c203dfd3f95ee0e3cd42ffe46cf7a8c27e681aca95dc311df7bf368e

See more details on using hashes here.

File details

Details for the file moceansdk-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: moceansdk-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for moceansdk-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 373920fd4ca0c4b3c2919f7ec060ae962d7f6926f96ebe0303ff6ac0c7760868
MD5 8c0fed8086e799980d7d4ba1458bd687
BLAKE2b-256 61c9f7c1dccb9ebaf3a88058e01dce3cde09413a8b275d192ed33ede81308ea0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page