MetaMotion / MetaWear Python SDK for Windows 10 and Linux
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
MetaWear-SDK-Cpp @ 9837aa3 api v0.6.2 commit Nov 15, 2018
examples More example script improvements Dec 17, 2018
mbientlab More example script improvements Dec 17, 2018
.gitignore commit for v0.1.1 Sep 29, 2017
.gitmodules commit for v0.1.1 Sep 29, 2017
LICENSE.txt commit for v0.1.1 Sep 29, 2017 Fixed exclude pattern Jul 26, 2018
README.rst api v0.5.0 commit Jul 26, 2018 api v0.6.2 commit Nov 15, 2018


MetaWear Python SDK

Python SDK for creating MetaWear apps on the Linux platform. This is a thin wrapper around the MetaWear C++ API so you will find the C++ documentation and API reference useful. Also, check out the scripts in the examples folder for full sample code.

This is not the pymetawear package. That is a community developed Python SDK which you can find over here .


Use pip to install the metawear package. It depends on PyWarble so ensure your target environment has the necessary dependencies installed.

pip install metawear


Import the MetaWear class and libmetawear variable from the metawear module and everything from the cbindings module.

from mbientlab.metawear import MetaWear, libmetawear
from mbientlab.metawear.cbindings import *

If you do not know the MAC address of your device, use PyWarble to scan for nearby devices.

from mbientlab.warble import *
from mbientlab.metawear import *
from threading import Event

e = Event()
address = None
def device_discover_task(result):
    global address
    if (result.has_service_uuid(MetaWear.GATT_SERVICE)):
        # grab the first discovered metawear device
        address = result.mac



Once you have the device's MAC address, create a MetaWear object with the MAC address and connect to the device.

device = MetaWear(address)

Upon a successful connection, you can begin calling any of the functions from the C++ SDK, for example, blinking the LED green.

pattern= LedPattern(repeat_count= Const.LED_REPEAT_INDEFINITELY)
libmetawear.mbl_mw_led_load_preset_pattern(byref(pattern), LedPreset.BLINK)
libmetawear.mbl_mw_led_write_pattern(device.board, byref(pattern), LedColor.GREEN)