{ "info": { "author": "MbientLab", "author_email": "hello@mbientlab.com", "bugtrack_url": null, "classifiers": [], "description": "====================\nMetaCloud Python SDK\n====================\nMetaCloud is a cloud service by MbientLab providing data storage, visualization, and analytics for your sensor data. \n\nIn order to run the example code in this tutorial, you will need to have an active subscription. If you need to create an account, follow the \ninstructions on this `page `_ to begin a free 3 day trial.\n\nInstallation\n============\nUse **pip** to install the ``metacloud`` package.\n\n.. code-block:: bash\n\n pip install metacloud --process-dependency-links\n\nIf you are syncing data from one of MbientLab's sensor boards, install the package with the **metawear** extra. \n\n.. code-block:: bash\n\n pip install metacloud[metawear] --process-dependency-links\n\nUsage\n=====\nAfter installing all of the necessary package, open a new Python file in your favorite text editor, import the **metawear** and **metacloud** \nmodules, and create the ``MetaWearClient`` and ``Session`` objects. The ``Session`` constructor requires several attributes that describe the device \nand your app: \n\n1. Firmware version \n2. MAC address \n3. Model name \n4. Friendly name identifying the device \n5. App name \n6. App revision \n\nIf you don't have an app name or revision, simply use the ``__file__`` variable for the app name and ``\"1.0.0\"`` for the app revision. \n\n.. code-block:: python\n\n from ctypes import cast, c_char_p\n from mbientlab.metacloud import Session\n from mbientlab.metawear import MetaWear, libmetawear, parse_value\n from mbientlab.metawear.cbindings import *\n\n mac = \"D4:5E:82:E1:15:01\"\n metawear = MetaWear(mac)\n metawear.connect()\n\n libmetawear.mbl_mw_settings_set_connection_parameters(metawear.board, 7.5, 7.5, 0, 6000)\n\n raw = libmetawear.mbl_mw_metawearboard_get_model_name(metawear.board)\n model_name = cast(raw, c_char_p).value.decode(\"ascii\")\n session = Session(metawear.info[\"firmware\"], mac, model_name, \"Device #1\", \"metacloud_py_tutorial\", \"1.0.0\")\n\nStart a data stream from the device and add the received values to the ``Session`` object. Here we will stream accelerometer data thus will forward \nit to the ``add_acc_data`` method. \n\n.. code-block:: python\n\n # Stream data at 100Hz\n libmetawear.mbl_mw_acc_set_range(metawear.board, 16.0)\n libmetawear.mbl_mw_acc_set_odr(metawear.board, 100.0)\n libmetawear.mbl_mw_acc_write_acceleration_config(metawear.board)\n\n def data_handler(ptr):\n value = parse_value(ptr)\n session.add_acc_data(ptr.contents.epoch, value.x, value.y, value.z)\n data_handler_fn = FnVoid_DataP(data_handler)\n\n signal = libmetawear.mbl_mw_acc_get_acceleration_data_signal(metawear.board)\n libmetawear.mbl_mw_datasignal_subscribe(signal, data_handler_fn)\n libmetawear.mbl_mw_acc_enable_acceleration_sampling(metawear.board)\n libmetawear.mbl_mw_acc_start(metawear.board)\n\nWhen you are ready to sync the data, stop the accelerometer then push the data to MetaCloud with ``sync`` method.\n\n.. code-block:: python\n\n # Stop the stream\n libmetawear.mbl_mw_acc_stop(metawear.board)\n libmetawear.mbl_mw_acc_disable_acceleration_sampling(metawear.board)\n libmetawear.mbl_mw_datasignal_unsubscribe(signal)\n # Sync to MetaCloud, replace with actual login credentials\n session.sync(\"username\", \"password\")", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/mbientlab/MetaCloud-SDK-Python/archive/0.2.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "https://mbientlab.com/license/", "maintainer": "", "maintainer_email": "", "name": "metacloud", "package_url": "https://pypi.org/project/metacloud/", "platform": "", "project_url": "https://pypi.org/project/metacloud/", "project_urls": { "Download": "https://github.com/mbientlab/MetaCloud-SDK-Python/archive/0.2.0.tar.gz" }, "release_url": "https://pypi.org/project/metacloud/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.2.0" }, "last_serial": 3327318, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "92f1f118fa8573929337176f663aba8e", "sha256": "ff671123cb2ec26739cd611904ad1b9a485143848c074f33bbebb7a513fbb6b7" }, "downloads": -1, "filename": "metacloud-0.2.0.tar.gz", "has_sig": false, "md5_digest": "92f1f118fa8573929337176f663aba8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3526, "upload_time": "2017-11-13T01:18:27", "url": "https://files.pythonhosted.org/packages/d8/6a/a891e06ae46833c6c9a5aaf20aaf94e4bd414ce691e015d8e6c93a368054/metacloud-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "92f1f118fa8573929337176f663aba8e", "sha256": "ff671123cb2ec26739cd611904ad1b9a485143848c074f33bbebb7a513fbb6b7" }, "downloads": -1, "filename": "metacloud-0.2.0.tar.gz", "has_sig": false, "md5_digest": "92f1f118fa8573929337176f663aba8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3526, "upload_time": "2017-11-13T01:18:27", "url": "https://files.pythonhosted.org/packages/d8/6a/a891e06ae46833c6c9a5aaf20aaf94e4bd414ce691e015d8e6c93a368054/metacloud-0.2.0.tar.gz" } ] }