{ "info": { "author": "Anton Morozenko", "author_email": "antoha.ua@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "# Blynk Python Library\nThis library provides API to connect IoT hardware that supports Micropython/Python to Blynk Cloud and communiate with Blynk apps (iOS and Android). You can send raw and processed sensor data and remotely control anything that is connected to your hardware (relays, motors, servos) from anywhere in the world. \n\n[![GitHub version](https://img.shields.io/github/release/blynkkk/lib-python.svg)][lib-release]\n[![GitHub download](https://img.shields.io/github/downloads/blynkkk/lib-python/total.svg)][lib-release]\n[![GitHub stars](https://img.shields.io/github/stars/blynkkk/lib-python.svg)][lib-stars]\n[![GitHub issues](https://img.shields.io/github/issues/blynkkk/lib-python.svg)][lib-issues]\n[![Build Status](https://img.shields.io/travis/blynkkk/lib-python.svg)][lib-travis]\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)][lib-licence]\n\nIf you like **Blynk** - give it a star, or fork it and contribute! \n[![GitHub stars](https://img.shields.io/github/stars/blynkkk/lib-python.svg?style=social&label=Star)][lib-stars] \n[![GitHub forks](https://img.shields.io/github/forks/blynkkk/lib-python.svg?style=social&label=Fork)][lib-network]\n\n\n![Blynk Banner][blynk-banner]\n### Blynk is **the most popular Internet of Things platform** for connecting hardware to the cloud, designing apps to control them, and managing your deployed devices at scale. \n\n- With Blynk Library you can connect **over 400 hardware models** (including ESP8266, ESP32, NodeMCU, all Arduinos, Raspberry Pi, Particle, Texas Instruments, etc.)to the Blynk Cloud.\nFull list of supported hardware can be found [here][blynk-hw].\n\n- With Blynk apps for **iOS** and **Android** apps you can easily build graphic interfaces for all of your projects by simply dragging and dropping widgets on your smartphone. It's a purely WYSIWG experience: no coding on iOS or Android required. \n\n- Hardware can connect to Blynk Cloud (open-source server) over the Internet using hardware connectivity on board, or with the use of various shields (Ethernet, WiFi, GSM, LTE, etc). Blynk Cloud is available for every user of Blynk **for free**. \n\n\n\n\n## Installation of Blynk Python Library \n\n#### Installation via python pip\n - Check python availability in your system. \n ```commandline\n python --version\n ``` \n To exclude compatibility issue preferable versions are Python 2.7.9 (or greater) or Python 3.4 (or greater)\n If python not present you can download and install it from [here][python-org]. \n\n **NOTE:** To run python in \"sandbox\" you can try **virtualenv** module. Check [this document][virtual-env] how to do it.\n\n - If you\u2019re using preferable versions of python mentioned above, then **pip** comes installed with Python by default. \n Check pip availability:\n ```commandline\n pip --version\n ``` \n - Install blynk library\n ```commandline\n sudo pip install blynklib\n ``` \n\n#### Manual installation\nLibrary can be installed locally from git sources: \n\n```commandline \ngit clone https://github.com/blynkkk/lib-python.git\ncd lib-python\npip install --user -e .\n\n# sudo pip install -e . # if installation needed not for current but for all users\n``` \n\n#### Testing\nYou can run unit tests on cPython systems using the command:\n\n python setup.py test\n\n**NOTE:** Unit tests for Micropython ENV are not available yet.\n\n#### Micropython installation\nSome hardware platforms can use **[Micropython][micropython-org]** package.\nThis is helpful for preliminary testing and debugging of your code outside of real hardware. Supported platforms \nand related installation docs can be found [here][micropython-pkg].\n\n\n## Features\nThis library supports Python2, Python3, and Micropython.\n\n- Communication with public or local [Blynk Server][blynk-server].\n- Exchange any data between your hardware and app\n- Tested to work with: Raspberry Pi (any), ESP32, ESP8266\n\n##### List of available operations:\n - Subscribe to connect/disconnect events \n - Subscribe to read/write events of [virtual pins][blynk-vpins]\n - [Virtual Pin][blynk-vpins] write\n - [Virtual Pin][blynk-vpins] sync\n - Send mobile app push notifications\n - Send email notifications\n - Send twitter notifications\n - Change widget GUI parameters in Blynk app based on hardware input\n\n\n## Quickstart \n1. Install Blynk python library as described above\n2. Install Blynk App: \n[ Google Play][blynk-app-android] | \n[ App Store][blynk-app-ios]\n\n- Create new account in Blynk app using your email address\n- Create a new Project in Blynk app \n- You will get Auth Token delivered to your email account. \n- Put this Auth Token within your python script to authenticate your device on [public][blynk-server-public] or [local][blynk-server]\n\n```python\nBLYNK_AUTH = '' #insert your Auth Token here\n```\n\n#### Usage example\n```python\nimport blynklib\n\nBLYNK_AUTH = '' #insert your Auth Token here\n# base lib init\nblynk = blynklib.Blynk(BLYNK_AUTH)\n\n# advanced options of lib init\n# from __future__ import print_function\n# blynk = blynklib.Blynk(BLYNK_AUTH, server='blynk-cloud.com', port=80, heartbeat=10, rcv_buffer=1024, log=print)\n\n# register handler for Virtual Pin V22 reading by Blynk App.\n# when a widget in Blynk App asks Virtual Pin data from server within given configurable interval (1,2,5,10 sec etc) \n# server automatically sends notification about read virtual pin event to hardware\n# this notification captured by current handler \n@blynk.handle_event('read V22')\ndef read_virtual_pin_handler(pin):\n\n # your code goes here\n # ...\n # Example: get sensor value, perform calculations, etc\n sensor_data = ''\n critilcal_data_value = ''\n\n # send value to Virtual Pin and store it in Blynk Cloud \n blynk.virtual_write(pin, sensor_data)\n\n # you can define if needed any other pin\n # example: blynk.virtual_write(24, sensor_data)\n\n # you can perform actions if value reaches a threshold (e.g. some critical value)\n if sensor_data >= critilcal_data_value\n\n blynk.set_property(pin, 'color', '#FF0000') # set red color for the widget UI element \n blynk.notify('Warning critical value') # send push notification to Blynk App \n blynk.email(, 'Email Subject', 'Email Body') # send email to specified address\n\n# main loop that starts program and handles registered events\nwhile True:\n blynk.run()\n```\n## Other Examples\n\nExamples can be found **[here][blynk-py-examples]** Check them all to get familiar with main Blynk API features.\n\n##### Core operations:\n- [01_write_virtual_pin.py](https://github.com/blynkkk/lib-python/blob/master/examples/01_write_virtual_pin.py): How to read incoming data from Blynk app to Virtual Pin and use it in your code\n- [02_read_virtual_pin.py](https://github.com/blynkkk/lib-python/blob/master/examples/02_read_virtual_pin.py): How to update value on Virtual Pin\n- [03_connect_disconnect.py](https://github.com/blynkkk/lib-python/blob/master/examples/03_connect_disconnect.py): Managing connection with Blynk Cloud\n- [04_email.py](https://github.com/blynkkk/lib-python/blob/master/examples/04_email.py): How to send send email and push notifications from your hardware \n- [05_set_property_notify.py](https://github.com/blynkkk/lib-python/blob/master/examples/05_set_property_notify.py): How to change some of widget UI properties like colors, labels, etc \n- [06_terminal_widget.py](https://github.com/blynkkk/lib-python/blob/master/examples/06_terminal_widget.py): Communication between hardware and app through Terminal widget)\n- [07_tweet_and_logging.py](https://github.com/blynkkk/lib-python/blob/master/examples/07_tweet_and_logging.py): How to post to Twitter and log events from your hardware\n- [08_blynk_timer.py](https://github.com/blynkkk/lib-python/blob/master/examples/08_blynk_timer.py): How send data periodically from hardware by using **[Blynk Timer][blynktimer-doc]**\n- [09_sync_virtual_pin.py](https://github.com/blynkkk/lib-python/blob/master/examples/09_sync_virtual_pin.py): How to sync virtual pin states and properties \n\n##### Raspberry Pi (any):\nRead [Raspberry Pi guide](https://github.com/blynkkk/lib-python/tree/master/examples/raspberry) first.\n\n- [01_weather_station_pi3b.py](https://github.com/blynkkk/lib-python/blob/master/examples/raspberry/01_weather_station_pi3b.py) Connect DHT22; BMP180 sensors and send data to Blynk app\n\n##### ESP32\nRead [ESP32 guide](https://github.com/blynkkk/lib-python/tree/master/examples/esp32) first.\n- [01_touch_button.py](https://github.com/blynkkk/lib-python/blob/master/examples/esp32/01_touch_button.py) Connect TTP223B touch sensor to ESP32 and react to touch\n- [02_terminal_cli.py](https://github.com/blynkkk/lib-python/blob/master/examples/esp32/02_terminal_cli.py) Communication between ESP32 hardware and app through Terminal widget\n- [03_temperature_humidity_dht22.py](https://github.com/blynkkk/lib-python/blob/master/examples/esp32/03_temperature_humidity_dht22.py) Connect DHT22 sensor to ESP32 and send data to Blynk app\n\n##### ESP8266\nRead [ESP8266 guide](https://github.com/blynkkk/lib-python/tree/master/examples/esp8266) first.\n- [01_potentiometer.py](https://github.com/blynkkk/lib-python/blob/master/examples/esp8266/01_potentiometer.py) Cconnect potentiometer to ESP8266 and send resistance value to the app \n\n\n\n### Memory size limitations\nFor hardware with limited memory size (ex. ESP8266) you can use ***frozen modules*** or ***frozen bytecode*** approaches\nto load **blynklib** or any other library to hardware.\n\nRead [this document][esp8266-readme] to get more information.\n\n## Documentation and other helpful links\n\n[Full Blynk Documentation](http://docs.blynk.cc/#blynk-firmware) - a complete guide on Blynk features\n\n[Community (Forum)](http://community.blynk.cc) - join a 500,000 Blynk community to ask questions and share ideas\n\n[Help Center](http://help.blynk.cc) - helpful articles on various Blynk aspects\n\n[Code Examples Browser](http://examples.blynk.cc) - browse examples to explore Blynk possibilities\n\n[Official Website](https://blynk.io) \n\n**Social Media:**\n\n[Facebook](https://www.fb.com/blynkapp) [Twitter](https://twitter.com/blynk_app) [Youtube](https://www.youtube.com/blynk)\n\n[Instagram](https://www.instagram.com/blynk.iot/) [LinkedIn](https://www.linkedin.com/company/b-l-y-n-k/)\n\n\n## Blynk libraries for other platforms\n* [C++](https://github.com/blynkkk/blynk-library)\n* [Node.js, Espruino, Browsers](https://github.com/vshymanskyy/blynk-library-js)\n* [Python](https://github.com/vshymanskyy/blynk-library-python) (by Volodymyr Shymanskyy)\n* [Particle](https://github.com/vshymanskyy/blynk-library-spark)\n* [Lua, OpenWrt, NodeMCU](https://github.com/vshymanskyy/blynk-library-lua)\n* [OpenWrt packages](https://github.com/vshymanskyy/blynk-library-openwrt)\n* [MBED](https://developer.mbed.org/users/vshymanskyy/code/Blynk/)\n* [Node-RED](https://www.npmjs.com/package/node-red-contrib-blynk-ws)\n* [LabVIEW](https://github.com/juncaofish/NI-LabVIEWInterfaceforBlynk)\n* [C#](https://github.com/sverrefroy/BlynkLibrary)\n\n## Contributing\nYou are very welcome to contribute: stability bugfixes, new hardware support, or any other improvements. Please.\n\n\n### License\nThis project is released under The MIT License (MIT)\n\n\n [lib-release]: https://github.com/blynkkk/lib-python/releases/latest\n [lib-licence]: https://github.com/blynkkk/lib-python/blob/master/LICENSE\n [lib-travis]: https://travis-ci.org/blynkkk/lib-python\n [lib-issues]: https://github.com/blynkkk/lib-python/issues\n [lib-stars]: https://github.com/blynkkk/lib-python/stargazers\n [lib-network]: https://github.com/blynkkk/lib-python/network\n [blynk-io]: https://github.com/blynkkk/blynkkk.github.io\n [blynk-hw]: https://github.com/blynkkk/blynkkk.github.io/blob/master/SupportedHardware.md\n [blynk-architecture]: https://github.com/blynkkk/blynkkk.github.io/blob/master/images/architecture.png\n [blynk-banner]: https://github.com/blynkkk/blynkkk.github.io/blob/master/images/GithubBanner.jpg\n [blynk-server]: https://github.com/blynkkk/blynk-server\n [blynk-server-public]: http://blynk-cloud.com\n [blynk-docs]: https://docs.blynk.cc/\n [blynk-py-examples]: https://github.com/blynkkk/lib-python/blob/master/examples\n [blynk-app-android]: https://play.google.com/store/apps/details?id=cc.blynk\n [blynk-app-ios]: https://itunes.apple.com/us/app/blynk-control-arduino-raspberry/id808760481?ls=1&mt=8\n [blynk-vpins]: http://help.blynk.cc/getting-started-library-auth-token-code-examples/blynk-basics/what-is-virtual-pins\n [python-org]: https://www.python.org/downloads/\n [micropython-org]: https://micropython.org/ \n [micropython-pkg]: https://github.com/micropython/micropython/wiki/Getting-Started\n [virtual-env]: https://virtualenv.pypa.io/en/latest/installation/\n [esp8266-readme]: https://github.com/blynkkk/lib-python/blob/master/examples/esp8266/README.md\n [blynktimer-doc]: https://github.com/blynkkk/lib-python/blob/master/TIMERS.md\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/blynkkk/lib-python", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "blynklib", "package_url": "https://pypi.org/project/blynklib/", "platform": "", "project_url": "https://pypi.org/project/blynklib/", "project_urls": { "Homepage": "https://github.com/blynkkk/lib-python" }, "release_url": "https://pypi.org/project/blynklib/0.2.5/", "requires_dist": null, "requires_python": "", "summary": "Blynk Python/Micropython library", "version": "0.2.5" }, "last_serial": 5756608, "releases": { "0.2.4": [ { "comment_text": "", "digests": { "md5": "1e937c73649ea2ddc5f0e04de6d01d30", "sha256": "b487a2204058235ae226d1107aa7beced1b518530d30cf7ccc3259ea10253d27" }, "downloads": -1, "filename": "blynklib-0.2.4-py2-none-any.whl", "has_sig": false, "md5_digest": "1e937c73649ea2ddc5f0e04de6d01d30", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 8954, "upload_time": "2019-03-20T20:55:10", "url": "https://files.pythonhosted.org/packages/a6/5b/89e6483c3ca6122633e666530e6b4afe304b6cfa628f6aa484eeb0d90e51/blynklib-0.2.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a8356ecd365a05e0a3cef198ffbb2701", "sha256": "591978639fa67ef57afeb04730a9c3e4cfe6e0a7ff5e267fc6f377a645348b20" }, "downloads": -1, "filename": "blynklib-0.2.4-py3-none-any.whl", "has_sig": false, "md5_digest": "a8356ecd365a05e0a3cef198ffbb2701", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8953, "upload_time": "2019-03-20T20:49:35", "url": "https://files.pythonhosted.org/packages/0b/2d/1eea0467849f94d9ff6b695bbe4a1034f61a96706a710ae6d1a574b7d557/blynklib-0.2.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf46e4537a926b804c057d21e6da0d56", "sha256": "437a4b117c926e96c1361c04afd41b2efec4370c13c16b5715b1559da071a20c" }, "downloads": -1, "filename": "blynklib-0.2.4.tar.gz", "has_sig": false, "md5_digest": "cf46e4537a926b804c057d21e6da0d56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14650, "upload_time": "2019-03-20T20:49:36", "url": "https://files.pythonhosted.org/packages/dc/a5/527ccbb9b94bc68d88a8e5a7f8fdb88154335d95edc0693ae34675eda138/blynklib-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "82e1f15c15e155a9676c4035e1976143", "sha256": "b0711cfe3945c65d462695636b8e62475dc9b534bd8ff77e3858fc29e3752abf" }, "downloads": -1, "filename": "blynklib-0.2.5-py2-none-any.whl", "has_sig": false, "md5_digest": "82e1f15c15e155a9676c4035e1976143", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11810, "upload_time": "2019-08-29T19:50:45", "url": "https://files.pythonhosted.org/packages/10/67/2849e0b59991173122ef94c4c665a51e2821f9a4799107fe5580b106a4dc/blynklib-0.2.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b2cbdd9320cf36759c94af9af4895254", "sha256": "9792df679aae4436f085518e63b1fd633eee95ce498961585dece12b2de40c54" }, "downloads": -1, "filename": "blynklib-0.2.5-py3-none-any.whl", "has_sig": false, "md5_digest": "b2cbdd9320cf36759c94af9af4895254", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11811, "upload_time": "2019-08-29T19:50:47", "url": "https://files.pythonhosted.org/packages/b8/23/cc0ff5f354a799ca99954907ebdedb43f4bf2e6d9d28d6afafbba008685a/blynklib-0.2.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2164817052af4c7a6f78cbb7c4f3d082", "sha256": "ea82deeadfccb4b2666fe9b782c846239a7947f77b11cb168119a8e795807f38" }, "downloads": -1, "filename": "blynklib-0.2.5.tar.gz", "has_sig": false, "md5_digest": "2164817052af4c7a6f78cbb7c4f3d082", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18731, "upload_time": "2019-08-29T19:50:50", "url": "https://files.pythonhosted.org/packages/43/12/1f1a2bdfabcaac27cd0629358d0323e0acdf5430f8a68e68c3f71afe2fb5/blynklib-0.2.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "82e1f15c15e155a9676c4035e1976143", "sha256": "b0711cfe3945c65d462695636b8e62475dc9b534bd8ff77e3858fc29e3752abf" }, "downloads": -1, "filename": "blynklib-0.2.5-py2-none-any.whl", "has_sig": false, "md5_digest": "82e1f15c15e155a9676c4035e1976143", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11810, "upload_time": "2019-08-29T19:50:45", "url": "https://files.pythonhosted.org/packages/10/67/2849e0b59991173122ef94c4c665a51e2821f9a4799107fe5580b106a4dc/blynklib-0.2.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b2cbdd9320cf36759c94af9af4895254", "sha256": "9792df679aae4436f085518e63b1fd633eee95ce498961585dece12b2de40c54" }, "downloads": -1, "filename": "blynklib-0.2.5-py3-none-any.whl", "has_sig": false, "md5_digest": "b2cbdd9320cf36759c94af9af4895254", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11811, "upload_time": "2019-08-29T19:50:47", "url": "https://files.pythonhosted.org/packages/b8/23/cc0ff5f354a799ca99954907ebdedb43f4bf2e6d9d28d6afafbba008685a/blynklib-0.2.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2164817052af4c7a6f78cbb7c4f3d082", "sha256": "ea82deeadfccb4b2666fe9b782c846239a7947f77b11cb168119a8e795807f38" }, "downloads": -1, "filename": "blynklib-0.2.5.tar.gz", "has_sig": false, "md5_digest": "2164817052af4c7a6f78cbb7c4f3d082", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18731, "upload_time": "2019-08-29T19:50:50", "url": "https://files.pythonhosted.org/packages/43/12/1f1a2bdfabcaac27cd0629358d0323e0acdf5430f8a68e68c3f71afe2fb5/blynklib-0.2.5.tar.gz" } ] }