pymodi-plus


Namepymodi-plus JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/LUXROBO/pymodi-plus
SummaryPython API for controlling modular electronics, MODI+.
upload_time2023-01-19 06:58:22
maintainer
docs_urlNone
authorLUXROBO
requires_python>=3.7
licenseMIT
keywords python modi modi-plus modi_plus modi+
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

[![Python Versions](https://img.shields.io/pypi/pyversions/pymodi-plus.svg?style=flat-square)](https://pypi.python.org/pypi/pymodi-plus)
[![PyPI Release (latest by date)](https://img.shields.io/github/v/release/LUXROBO/pymodi-plus?style=flat-square)](https://pypi.python.org/pypi/pymodi-plus)
[![Read the Docs (version)](https://img.shields.io/readthedocs/pymodi-plus/latest?style=flat-square)](https://pymodi-plus.readthedocs.io/en/latest/?badge=master)
[![GitHub Workflow Status (Build)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/build.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions)
[![GitHub LICENSE](https://img.shields.io/github/license/LUXROBO/pymodi-plus?style=flat-square&color=blue)](https://github.com/LUXROBO/pymodi-plus/blob/master/LICENSE)
[![Lines of Code](https://img.shields.io/tokei/lines/github/LUXROBO/pymodi-plus?style=flat-square)](https://github.com/LUXROBO/pymodi-plus/tree/master/modi_plus)

</div>

Description
===========
> Python API for controlling modular electronics, MODI+.


Features
--------
PyMODI+ provides a control of modular electronics.
* Platform agnostic control of modules through serial connection
* Utilities of wireless connection with BLE (Bluetooth Low Engery)

Build Status
------------
|master|develop|
|:---:|:---:|
| [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/build.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/build.yml?branch=develop)](https://github.com/LUXROBO/pymodi-plus/actions)

System Support
--------------
| System | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 |
| :---: | :---: | :---: | :---: | :---: | :---: |
| Linux | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_ubuntu.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_ubuntu.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_ubuntu.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_ubuntu.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_ubuntu.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions)
| Mac OS | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_macos.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_macos.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_macos.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_macos.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_macos.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions)
| Windows | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_windows.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_windows.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_windows.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_windows.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_windows.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions)

Contribution Guidelines
-----------------------
We appreciate all contributions. If you are planning to report bugs, please do so [here](https://github.com/LUXROBO/pymodi/issues). Feel free to fork our repository to your local environment, and please send us feedback by filing an issue.

If you want to contribute to pymodi, be sure to review the contribution guidelines. This project adheres to pymodi's code of conduct. By participating, you are expected to uphold this code.

[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-square)](CODE_OF_CONDUCT.md)

Installation
------------
> When installing PyMODI+ package, we highly recommend you to use Anaconda to manage the distribution.
> With Anaconda, you can use an isolated virtual environment, solely for PyMODI+.

[Optional] Once you install [Anaconda](https://docs.anaconda.com/anaconda/install/), then:
```
# Install new python environment for PyMODI+ package, choose python version >= 3.7
conda create --name pymodi_plus python=3.7

# After you properly install the python environment, activate it
conda activate pymodi_plus

# Ensure that your python version is compatible with PyMODI+
python --version
```

Install the latest PyMODI+ if you haven't installed it yet:
```
python -m pip install pymodi-plus --user --upgrade
```

Usage
-----
Import modi_plus package and create MODIPlus object (we call it "bundle", a bundle of MODI+ modules).
```python
# Import modi_plus package
import modi_plus

"""
Create MODIPlus object, make sure that you have connected your network module
to your machine while other modules are attached to the network module
"""
bundle = modi_plus.MODIPlus()
```

[Optional] Specify how you would like to establish the connection between your machine and the network module.
```python
# 1. Serial connection (via USB), it's the default connection method
bundle = modi_plus.MODIPlus(connection_type="serialport")

# 2. BLE (Bluetooth Low Energy) connection, it's wireless! But it can be slow :(
bundle = modi_plus.MODIPlus(conn_type="ble", network_uuid="YOUR_NETWORK_MODULE_UUID")
```

List and create connected modules' object.
```python
# List connected modules
print(bundle.modules)

# List connected leds
print(bundle.leds)

# Pick the first led object from the bundle
led = bundle.leds[0]
```

Let's blink the LED 5 times.
```python
import time

for _ in range(5):
    # turn on for 0.5 second
    led.turn_on()
    time.sleep(0.5)

    # turn off for 0.5 second
    led.turn_off()
    time.sleep(0.5)
```

If you are still not sure how to use PyMODI, you can play PyMODI tutorial over REPL:
```
$ python -m modi_plus --tutorial
```
As well as an interactive usage examples:
```
$ python -m modi_plus --usage
```

Additional Usage
----------------
To diagnose MODI+ modules (helpful to find existing malfunctioning modules),
```
$ python -m modi_plus --inspect
```

To initialize MODI+ modules implicitly (set `i` flag to enable REPL mode),
```
$ python -im modi_plus --initialize
```

To see what other commands are available,
```
$ python -m modi_plus --help
```

History
==

0.3.0 (2023-01-19)
--
* Feature
1. Add `draw_dot` function on display module

* Patch
1. Fix `write_text` function error on display module if text length is 23
2. Change module constructor argument from uuid to id

0.2.1 (2022-12-02)
--
* Patch
1. Refactor `write_text` input type on display module

0.2.0 (2022-12-02)
--
* Feature
1. Refactor getter/setter for each MODI+ module

0.1.1 (2022-11-23)
--
* Feature
1. Change python minimum version to 3.7

0.1.0 (2022-11-22)
--
* Feature
1. Add creation examples (brush, dodge)
2. Add network, battery module functions
3. Fix `play_music` function on speaker module
4. Add preset resource on speaker and display module
5. Add search module time and timeout exception

0.0.2 (2022-11-18)
--
* Feature
1. Change python minimum version to 3.9

0.0.1 (2022-11-15)
--
* Release initial version of the package on in-house GitHub



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/LUXROBO/pymodi-plus",
    "name": "pymodi-plus",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "python,modi,modi-plus,modi_plus,modi+",
    "author": "LUXROBO",
    "author_email": "module.dev@luxrobo.com",
    "download_url": "https://files.pythonhosted.org/packages/42/11/249993237ee9b0a04c845b8056b47775b08afd9ba4dc2ef3b2078d86db1c/pymodi-plus-0.3.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n[![Python Versions](https://img.shields.io/pypi/pyversions/pymodi-plus.svg?style=flat-square)](https://pypi.python.org/pypi/pymodi-plus)\n[![PyPI Release (latest by date)](https://img.shields.io/github/v/release/LUXROBO/pymodi-plus?style=flat-square)](https://pypi.python.org/pypi/pymodi-plus)\n[![Read the Docs (version)](https://img.shields.io/readthedocs/pymodi-plus/latest?style=flat-square)](https://pymodi-plus.readthedocs.io/en/latest/?badge=master)\n[![GitHub Workflow Status (Build)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/build.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions)\n[![GitHub LICENSE](https://img.shields.io/github/license/LUXROBO/pymodi-plus?style=flat-square&color=blue)](https://github.com/LUXROBO/pymodi-plus/blob/master/LICENSE)\n[![Lines of Code](https://img.shields.io/tokei/lines/github/LUXROBO/pymodi-plus?style=flat-square)](https://github.com/LUXROBO/pymodi-plus/tree/master/modi_plus)\n\n</div>\n\nDescription\n===========\n> Python API for controlling modular electronics, MODI+.\n\n\nFeatures\n--------\nPyMODI+ provides a control of modular electronics.\n* Platform agnostic control of modules through serial connection\n* Utilities of wireless connection with BLE (Bluetooth Low Engery)\n\nBuild Status\n------------\n|master|develop|\n|:---:|:---:|\n| [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/build.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/build.yml?branch=develop)](https://github.com/LUXROBO/pymodi-plus/actions)\n\nSystem Support\n--------------\n| System | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 |\n| :---: | :---: | :---: | :---: | :---: | :---: |\n| Linux | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_ubuntu.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_ubuntu.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_ubuntu.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_ubuntu.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_ubuntu.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions)\n| Mac OS | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_macos.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_macos.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_macos.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_macos.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_macos.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions)\n| Windows | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_windows.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_windows.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_windows.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_windows.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions) | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/LUXROBO/pymodi-plus/unit_test_windows.yml?branch=master)](https://github.com/LUXROBO/pymodi-plus/actions)\n\nContribution Guidelines\n-----------------------\nWe appreciate all contributions. If you are planning to report bugs, please do so [here](https://github.com/LUXROBO/pymodi/issues). Feel free to fork our repository to your local environment, and please send us feedback by filing an issue.\n\nIf you want to contribute to pymodi, be sure to review the contribution guidelines. This project adheres to pymodi's code of conduct. By participating, you are expected to uphold this code.\n\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-square)](CODE_OF_CONDUCT.md)\n\nInstallation\n------------\n> When installing PyMODI+ package, we highly recommend you to use Anaconda to manage the distribution.\n> With Anaconda, you can use an isolated virtual environment, solely for PyMODI+.\n\n[Optional] Once you install [Anaconda](https://docs.anaconda.com/anaconda/install/), then:\n```\n# Install new python environment for PyMODI+ package, choose python version >= 3.7\nconda create --name pymodi_plus python=3.7\n\n# After you properly install the python environment, activate it\nconda activate pymodi_plus\n\n# Ensure that your python version is compatible with PyMODI+\npython --version\n```\n\nInstall the latest PyMODI+ if you haven't installed it yet:\n```\npython -m pip install pymodi-plus --user --upgrade\n```\n\nUsage\n-----\nImport modi_plus package and create MODIPlus object (we call it \"bundle\", a bundle of MODI+ modules).\n```python\n# Import modi_plus package\nimport modi_plus\n\n\"\"\"\nCreate MODIPlus object, make sure that you have connected your network module\nto your machine while other modules are attached to the network module\n\"\"\"\nbundle = modi_plus.MODIPlus()\n```\n\n[Optional] Specify how you would like to establish the connection between your machine and the network module.\n```python\n# 1. Serial connection (via USB), it's the default connection method\nbundle = modi_plus.MODIPlus(connection_type=\"serialport\")\n\n# 2. BLE (Bluetooth Low Energy) connection, it's wireless! But it can be slow :(\nbundle = modi_plus.MODIPlus(conn_type=\"ble\", network_uuid=\"YOUR_NETWORK_MODULE_UUID\")\n```\n\nList and create connected modules' object.\n```python\n# List connected modules\nprint(bundle.modules)\n\n# List connected leds\nprint(bundle.leds)\n\n# Pick the first led object from the bundle\nled = bundle.leds[0]\n```\n\nLet's blink the LED 5 times.\n```python\nimport time\n\nfor _ in range(5):\n    # turn on for 0.5 second\n    led.turn_on()\n    time.sleep(0.5)\n\n    # turn off for 0.5 second\n    led.turn_off()\n    time.sleep(0.5)\n```\n\nIf you are still not sure how to use PyMODI, you can play PyMODI tutorial over REPL:\n```\n$ python -m modi_plus --tutorial\n```\nAs well as an interactive usage examples:\n```\n$ python -m modi_plus --usage\n```\n\nAdditional Usage\n----------------\nTo diagnose MODI+ modules (helpful to find existing malfunctioning modules),\n```\n$ python -m modi_plus --inspect\n```\n\nTo initialize MODI+ modules implicitly (set `i` flag to enable REPL mode),\n```\n$ python -im modi_plus --initialize\n```\n\nTo see what other commands are available,\n```\n$ python -m modi_plus --help\n```\n\nHistory\n==\n\n0.3.0 (2023-01-19)\n--\n* Feature\n1. Add `draw_dot` function on display module\n\n* Patch\n1. Fix `write_text` function error on display module if text length is 23\n2. Change module constructor argument from uuid to id\n\n0.2.1 (2022-12-02)\n--\n* Patch\n1. Refactor `write_text` input type on display module\n\n0.2.0 (2022-12-02)\n--\n* Feature\n1. Refactor getter/setter for each MODI+ module\n\n0.1.1 (2022-11-23)\n--\n* Feature\n1. Change python minimum version to 3.7\n\n0.1.0 (2022-11-22)\n--\n* Feature\n1. Add creation examples (brush, dodge)\n2. Add network, battery module functions\n3. Fix `play_music` function on speaker module\n4. Add preset resource on speaker and display module\n5. Add search module time and timeout exception\n\n0.0.2 (2022-11-18)\n--\n* Feature\n1. Change python minimum version to 3.9\n\n0.0.1 (2022-11-15)\n--\n* Release initial version of the package on in-house GitHub\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python API for controlling modular electronics, MODI+.",
    "version": "0.3.0",
    "split_keywords": [
        "python",
        "modi",
        "modi-plus",
        "modi_plus",
        "modi+"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "edd2634e68bac4bc32ffd5e61616478316969aa358acde8d2a5321d44445ac0b",
                "md5": "cdfe53a78cdcb5c5bf1bc100cf86731f",
                "sha256": "3d5022d13d4811f946bccf0f8a8a116f41f2babff5f57cdc3a1bc2bb18ade380"
            },
            "downloads": -1,
            "filename": "pymodi_plus-0.3.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cdfe53a78cdcb5c5bf1bc100cf86731f",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.7",
            "size": 1537922,
            "upload_time": "2023-01-19T06:58:20",
            "upload_time_iso_8601": "2023-01-19T06:58:20.739511Z",
            "url": "https://files.pythonhosted.org/packages/ed/d2/634e68bac4bc32ffd5e61616478316969aa358acde8d2a5321d44445ac0b/pymodi_plus-0.3.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4211249993237ee9b0a04c845b8056b47775b08afd9ba4dc2ef3b2078d86db1c",
                "md5": "c55533d6e6462ec13d8cf707dfc6c43e",
                "sha256": "055f8e9b9b94d599b16208eb568cb67f4b032e79e5920d5014b7395ccaf0e703"
            },
            "downloads": -1,
            "filename": "pymodi-plus-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c55533d6e6462ec13d8cf707dfc6c43e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 1533415,
            "upload_time": "2023-01-19T06:58:22",
            "upload_time_iso_8601": "2023-01-19T06:58:22.519605Z",
            "url": "https://files.pythonhosted.org/packages/42/11/249993237ee9b0a04c845b8056b47775b08afd9ba4dc2ef3b2078d86db1c/pymodi-plus-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-19 06:58:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "LUXROBO",
    "github_project": "pymodi-plus",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pymodi-plus"
}
        
Elapsed time: 0.03781s