Skip to main content

MoBagel SDK for Python.

Project description

# mobagel-python-sdk

## Introduce

MoBagel is a real-time cloud analytics platform that helps IoT companies monitor and analyze hardware usage, speed up research and development, forecast sales and marketing strategies, and proactively engage with customers to prevent product returns. As a result, companies can also save up to millions in cost reductions.

## Installation


To run the example project, clone the repo, or run pip install from the Example directory first.

* Install by PyPI
`$ pip install mobagel-python-sdk`


## Getting Started

#### - Creating an account

If you do not have an account, please create an account [here](https://app.mobagel.com/signup). After you create an account, you will be directed to the dashboard.

#### - Creating a new product
To use MoBagel, you first have to create a **product**, which is essentially a group of same **devices**. You can create new products in the dashboard.

For example:

[Product Name] iBulb
[Product Brief] Smart light bulb
[Product Description] Wi-Fi connected light bulb with motion sensors and temperature sensors.
After you create a **product**, the system will generate a **product_key**, which will be used to create **devices** later on.

#### - Register your first device
Once you generated a product_key from the dashboard, you can use the product_key and registerDevice function to register a device in your application.

## import package
import pybagel

## create mobagel object
client = pybagel.Client(product_key="1111111111222222222233333333334444444444555555555566666666667777")

## register a device
device_key = c.registerDevice()


#### - Connecting custom properties or events
In your device application, you will need to prepare your report before sending it to MoBagel.

* Determining different states of your devices to send along with your report

# example states

"state": "normal"
"state": "error"

* Adding custom properties or events with a key beginning with c_

# example custom properties or events

"c_temperature": 30
"c_event": "turned_on"
* Deciding when to send reports (time, frequency, events)


#### - Sending first report
Once you connect the sensor properties, you can generate a report with the sendReport function.

# sample report
report_content = {
"state": "normal",
"c_humidity": 30,
"c_function": "humidify" ,
"c_temperature": 80
}

client.sendReport(device_key, report_content)




## More
You can visit our home page and get more information.
[https://mobagel.com](https://mobagel.com)

## Author

MoBagel, us@mobagel.com

## License

MoBagel Software Development Kit (SDK) License Agreement


Subject to the terms of this License Agreement, you are hereby granted a worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use, copy, modify, and distribute this software in source code or binary form to use the SDK solely to develop applications to connect with MoBagel’s platform.

MoBagel owns all legal right, title and interest in and to the SDK. MoBagel reserves all rights not expressly granted to you.

The form and nature of the SDK that MoBagel provides may change without prior notice to you. This SDK is provided “as is”, without warranty of any kind, express or limited. MoBagel may stop (permanently or temporarily) providing the SDK to users at MoBagel's sole discretion without prior notice.

You are not granted the right to use MoBagel’s trademarks, logos, domain names, or other distinctive brand features.

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

mobagel-python-sdk-1.1.0.tar.gz (4.0 kB view hashes)

Uploaded Source

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