{ "info": { "author": "Virantha N. Ekanayake", "author_email": "virantha@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "BrickNil - Control LEGO Bluetooth Sensors and Motors with Python\n=================================================================\n\n|image_pypi| |image_downloads| |image_license| |passing| |quality| |Coverage Status|\n\n.. |image_pypi| image:: https://img.shields.io/pypi/v/bricknil.svg\n :target: https://pypi.python.org/pypi/bricknil\n.. |image_downloads| image:: https://img.shields.io/pypi/dd/bricknil.svg\n.. |image_license| image:: https://img.shields.io/pypi/l/bricknil.svg\n :target: https://www.apache.org/licenses/LICENSE-2.0\n.. |passing| image:: https://scrutinizer-ci.com/g/virantha/bricknil/badges/build.png?b=master\n.. |quality| image:: https://scrutinizer-ci.com/g/virantha/bricknil/badges/quality-score.png?b=master\n :target: https://scrutinizer-ci.com/g/virantha/bricknil\n.. |Coverage Status| image:: https://img.shields.io/coveralls/github/virantha/bricknil.svg\n :target: https://coveralls.io/r/virantha/bricknil\n\n.. |reg| unicode:: U+000AE .. REGISTERED SIGN\n\nBrickNil [*]_ provides an easy way to connect to and program LEGO\\ |reg|\nBluetooth hubs (including the PoweredUp Passenger Train 60197_ and Cargo Train 60198_ sets, and the Lego\nDuplo Steam Train 10874_ and Cargo Train 10875_ ) using Python on OS X and\nLinux. This work was inspired by this EuroBricks_ thread, and the NodeJS Powered-Up_\nlibrary. Unlike the official apps available from LEGO, BrickNil allows you to control multiple\nhubs with a single program, which lets you easily scale to programming large interactive systems.\n\nBrickNil requires modern Python (designed and tested for 3.7) and uses asynchronous\nevent programming built on top of the Curio_ async library. As an aside, the choice of\nasync library is fairly arbitrary; and enabling another library such as asyncio or Trio\nshould be straightforward.\n\nAn example BrickNil program for controlling the Train motor speed is shown below:\n\n.. code-block:: python\n\n from curio import sleep\n from bricknil import attach, start\n from bricknil.hub import PoweredUpHub\n from bricknil.sensor import TrainMotor\n\n @attach(TrainMotor, name='motor')\n class Train(PoweredUpHub):\n\n async def run(self):\n for i in range(2): # Repeat this control two times\n await self.motor.ramp_speed(80,5000) # Ramp speed to 80 over 5 seconds\n await sleep(6)\n await self.motor.ramp_speed(0,1000) # Brake to 0 over 1 second\n await sleep(2)\n\n async def system():\n train = Train('My train')\n\n if __name__ == '__main__':\n start(system)\n\n\n* Free and open-source software: ASL2 license\n* Documentation: http://virantha.github.io/bricknil\n* Source: https://github.com/virantha/bricknil\n\n.. [*] BrickNil's name comes from the word \"Nil\" (\u0db1\u0dd2\u0dbd\u0dca) in Sinhala_ which means Blue (as in Bluetooth)\n\n.. _Sinhala: https://en.wikipedia.org/wiki/Sinhalese_language\n.. _60197: https://www.amazon.com/gp/product/B07CC37F63/ref=as_li_tl?ie=UTF8&tag=virantha-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07CC37F63\n.. _60198: https://www.amazon.com/gp/product/B07C39LCZ9/ref=as_li_tl?ie=UTF8&tag=virantha-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07C39LCZ9\n.. _10874: https://www.amazon.com/gp/product/B07BK6M2WC/ref=as_li_tl?ie=UTF8&tag=virantha-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07BK6M2WC\n.. _10875: https://www.amazon.com/gp/product/B07BK6KQR6/ref=as_li_tl?ie=UTF8&tag=virantha-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B07BK6KQR6\n.. _Boost: https://www.amazon.com/gp/product/B06Y6JCTKH/ref=as_li_tl?ie=UTF8&tag=virantha-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B06Y6JCTKH\n\nFeatures\n########\n\n* Supports the following LEGO\\ |reg| Bluetooth systems:\n * PoweredUp hubs for trains 60197_, 60198_\n * Duplo trains 10874_ and 10875_\n * PoweredUp remote\n * Boost_ Move hub\n* Supports the following actuators/sensors:\n * Internal motors\n * Train motors\n * Hub LED color\n * Boost vision sensor (color, distance)\n * Boost internal tilt/orientation/accelerometer\n * Boost external motor\n * External light\n * Hub buttons\n * Wedo external motor\n * Wedo tiltand motion sensors\n* Fully supports Python asynchronous keywords and coroutines\n * Allows expressive concurrent programming using async/await syntax\n * The current implementation uses the async library Curio_ by David Beazley\n* Cross-platform\n * Uses the Adafruit Bluefruit BluetoothLE library for Mac OS X\n * Uses the Bleak Bluetooth library for Linux and Win10; also tested on Raspberry Pi.\n\n\n.. _Curio: http://curio.readthedocs.io\n.. _EuroBricks: https://www.eurobricks.com/forum/index.php?/forums/topic/162288-powered-up-a-tear-down/\n.. _Powered-Up: https://github.com/nathankellenicki/node-poweredup\n.. _Bleak: https://github.com/hbldh/bleak\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://virantha.github.io/bricknil", "keywords": "", "license": "ASL 2.0", "maintainer": "", "maintainer_email": "", "name": "bricknil", "package_url": "https://pypi.org/project/bricknil/", "platform": "", "project_url": "https://pypi.org/project/bricknil/", "project_urls": { "Homepage": "https://virantha.github.io/bricknil" }, "release_url": "https://pypi.org/project/bricknil/0.9.2/", "requires_dist": [ "pyyaml", "curio", "bluebrick-Adafruit-BluefruitLE (>=0.9.12)", "bricknil-bleak ; sys_platform != \"darwin\"", "pyobjc ; sys_platform == \"darwin\"" ], "requires_python": "", "summary": "Control LEGO(tm) BluetoothLE Hubs, Motors, and Sensors using Async Python", "version": "0.9.2" }, "last_serial": 5239027, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "1555e70de2995db2105823c7ec5be35a", "sha256": "292356804446aaa53ebe2d3cef88be7b93a61664849f356afeb61bdc3f8fe8f4" }, "downloads": -1, "filename": "bricknil-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "1555e70de2995db2105823c7ec5be35a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 56973, "upload_time": "2019-02-23T20:03:14", "url": "https://files.pythonhosted.org/packages/5d/fd/abf2a81e246d6dfb1f40a7deddbe813616265e9874f970d7f046581ae385/bricknil-0.3-py3-none-any.whl" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "02cff824eb3937822b659e9cc1be15e6", "sha256": "33f274696aa8a3a3070cd0358938338591a7e35e5f6573aeca9f89c82988e655" }, "downloads": -1, "filename": "bricknil-0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "02cff824eb3937822b659e9cc1be15e6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 60107, "upload_time": "2019-03-01T18:57:21", "url": "https://files.pythonhosted.org/packages/80/9f/13bf8ab4f3052c9e47a1477dafc60c870d7649d87facad81e7e13dda2d15/bricknil-0.4-py3-none-any.whl" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "891bbc371c089b24759fc59452b4e7ce", "sha256": "20626d69fe5f1634834a41cde5171e05722c813fecdb5f404fa55a0a69f12506" }, "downloads": -1, "filename": "bricknil-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "891bbc371c089b24759fc59452b4e7ce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 59000, "upload_time": "2019-03-18T17:22:16", "url": "https://files.pythonhosted.org/packages/1f/b9/17c580bf937f9fd386333e644cc0a995d82e8103a458ad995ca93ecc8d6d/bricknil-0.5-py3-none-any.whl" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "4f23758e8d5c1c9c893099827eed6d09", "sha256": "a1aa618fa6b1bbbc75123294cdb8294c47687450fa04ee5cad292847d5467840" }, "downloads": -1, "filename": "bricknil-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4f23758e8d5c1c9c893099827eed6d09", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 59924, "upload_time": "2019-03-22T03:21:52", "url": "https://files.pythonhosted.org/packages/fe/b9/b9c3de7e37fefe9cb5d62b3f4aa112c490720c635fdfc9ebd2bf89955050/bricknil-0.5.1-py3-none-any.whl" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "9bb20152073054f2c58dee24ceb33c06", "sha256": "4297df8c7271d897cc9f61617a3254e259ae949fa8ee68ae669e903d8d097c57" }, "downloads": -1, "filename": "bricknil-0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "9bb20152073054f2c58dee24ceb33c06", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 60136, "upload_time": "2019-03-22T04:33:54", "url": "https://files.pythonhosted.org/packages/4e/e4/25ab153eedbfa46668cf836a20c7bfdefd131e4232a6a9d4731fae53cc36/bricknil-0.6-py3-none-any.whl" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "ba71264696c4d7c419dc7a444d6479f5", "sha256": "8739b5596a02a46314c8a663eb25df6d5c7a18b47d29e99414bf1796e3c18ed8" }, "downloads": -1, "filename": "bricknil-0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "ba71264696c4d7c419dc7a444d6479f5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 60713, "upload_time": "2019-03-22T19:47:52", "url": "https://files.pythonhosted.org/packages/73/2d/f1be9414dec7eb46d886c8928bdcefa64bda0b23ef9b27f879cda63090e1/bricknil-0.7-py3-none-any.whl" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "4b34bd258daf7c8a585a998e5c9471f7", "sha256": "d63ddca657dc0201716feeab698d3be31bc447747ef5182861533d204d85a29b" }, "downloads": -1, "filename": "bricknil-0.7.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4b34bd258daf7c8a585a998e5c9471f7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 62854, "upload_time": "2019-03-25T20:51:19", "url": "https://files.pythonhosted.org/packages/e1/c6/0447ddf278069f828d2248504a84a2003e4d18d2c46b00b65decaf75aa5e/bricknil-0.7.1-py3-none-any.whl" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "33907f75f3c9a53334bdfc8e67fc498a", "sha256": "1d6505fa81b8c986b531265aab2f3c3bd7d319c538ed72714b3e0047ec5cc1d8" }, "downloads": -1, "filename": "bricknil-0.7.2-py3-none-any.whl", "has_sig": false, "md5_digest": "33907f75f3c9a53334bdfc8e67fc498a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 63082, "upload_time": "2019-03-26T16:18:15", "url": "https://files.pythonhosted.org/packages/de/97/03ebca00828892363b1d53be94018b0f5787c1b97152cd1916b2a56d4bb6/bricknil-0.7.2-py3-none-any.whl" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "e6fb6413a7d0a84eec595b45af1653ec", "sha256": "899782be3a83c80f3f324a9342362e0918d86274c0b29093d694d7f8dd35c9fc" }, "downloads": -1, "filename": "bricknil-0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "e6fb6413a7d0a84eec595b45af1653ec", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 62633, "upload_time": "2019-04-01T15:29:00", "url": "https://files.pythonhosted.org/packages/db/3c/8cc529e2ab3eb43db6b7374d22a579d77a926311a6e99e405febb343d852/bricknil-0.8-py3-none-any.whl" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "4fed03577395900cd40209f37aceb953", "sha256": "e35ba08cb2df1922f54490c42055a97d013c032ae3a23bee3d8037c0141e9c57" }, "downloads": -1, "filename": "bricknil-0.8.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4fed03577395900cd40209f37aceb953", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 63387, "upload_time": "2019-04-03T03:23:11", "url": "https://files.pythonhosted.org/packages/65/10/2b37fb53e12e327c7c3f14b9fa440c83b82fc40b18860d131788d1b710c4/bricknil-0.8.1-py3-none-any.whl" } ], "0.8.2": [ { "comment_text": "", "digests": { "md5": "93a98a58b50991419008b0a14d145e9d", "sha256": "b6ab83926f11375063e6610bf1a959e3e715d070f6ce95055eb09fe302c3bda6" }, "downloads": -1, "filename": "bricknil-0.8.2-py3-none-any.whl", "has_sig": false, "md5_digest": "93a98a58b50991419008b0a14d145e9d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 64118, "upload_time": "2019-04-03T16:23:29", "url": "https://files.pythonhosted.org/packages/61/42/c217d7e93857be3f8676be41d228c091829a4dd87a9c7f74e0874ed14a88/bricknil-0.8.2-py3-none-any.whl" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "42e15c42b6caa1602738f77663da191e", "sha256": "98712fea02ee02c4dc8698f08625b7da57a5d0369ca0b93b920b62559d79d4a2" }, "downloads": -1, "filename": "bricknil-0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "42e15c42b6caa1602738f77663da191e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 82575, "upload_time": "2019-04-15T17:39:32", "url": "https://files.pythonhosted.org/packages/b4/5f/72f1e013b36213afa58b803c99240df113e1e46ee41df7863905effc519d/bricknil-0.9-py3-none-any.whl" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "790430230ee4a059bbbb007d456ebcee", "sha256": "c095fee242682ea6d7ce61dea80fe92e9c2c7a9b194d26ed99149a90a659035a" }, "downloads": -1, "filename": "bricknil-0.9.1-py3-none-any.whl", "has_sig": false, "md5_digest": "790430230ee4a059bbbb007d456ebcee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 83318, "upload_time": "2019-04-24T12:52:53", "url": "https://files.pythonhosted.org/packages/4d/5f/8c96dc5767f12f5659d4346047d7668a7c8ebeef2f3005736111e56a1f28/bricknil-0.9.1-py3-none-any.whl" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "bac182743489f10bb21491ac0d02c730", "sha256": "2f3382a24859dd28cff8e545d680584c360a199399525485624e27fd1fcb429a" }, "downloads": -1, "filename": "bricknil-0.9.2-py3-none-any.whl", "has_sig": false, "md5_digest": "bac182743489f10bb21491ac0d02c730", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 84924, "upload_time": "2019-05-07T16:56:04", "url": "https://files.pythonhosted.org/packages/28/62/0d627ec7f58648dd51e94073fac2efc81fb2783ee319694859ab13c654e6/bricknil-0.9.2-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bac182743489f10bb21491ac0d02c730", "sha256": "2f3382a24859dd28cff8e545d680584c360a199399525485624e27fd1fcb429a" }, "downloads": -1, "filename": "bricknil-0.9.2-py3-none-any.whl", "has_sig": false, "md5_digest": "bac182743489f10bb21491ac0d02c730", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 84924, "upload_time": "2019-05-07T16:56:04", "url": "https://files.pythonhosted.org/packages/28/62/0d627ec7f58648dd51e94073fac2efc81fb2783ee319694859ab13c654e6/bricknil-0.9.2-py3-none-any.whl" } ] }