{ "info": { "author": "UNICORN Data Analysis", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: AsyncIO", "Intended Audience :: Developers", "Intended Audience :: Financial and Insurance Industry", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Office/Business :: Financial :: Investment", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "![GitHub release](https://img.shields.io/github/release/unicorn-data-analysis/unicorn-binance-websocket-api.svg) \n![GitHub](https://img.shields.io/github/license/unicorn-data-analysis/unicorn-binance-websocket-api.svg?color=blue) \n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/unicorn-binance-websocket-api.svg) \n![code coverage 100%](https://img.shields.io/badge/coverage-100%25-brightgreen.svg) \n![PyPI - Status](https://img.shields.io/pypi/status/unicorn-binance-websocket-api.svg) \n![PyPI - Wheel](https://img.shields.io/pypi/wheel/unicorn-binance-websocket-api.svg?label=PyPI%20wheel&color=orange) \n![PyPI - Downloads](https://img.shields.io/pypi/dm/unicorn-binance-websocket-api.svg?label=PyPI%20downloads&color=orange)\n\n# UNICORN Binance WebSocket API\nA python API to use the Binance Websocket API's (com, jersey, us, dex/chain) in a easy, fast, flexible, robust and fully-featured way.\n\n### Create a multiplex websocket connection to Binance with just 3 lines of code:\n```\nfrom unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager import BinanceWebSocketApiManager\n\nbinance_websocket_api_manager = BinanceWebSocketApiManager(exchange=\"binance.com\")\nbinance_websocket_api_manager.create_stream(['trade', 'kline_1m'], ['btcusdt', 'bnbbtc', 'ethbtc'])\n```\n### And 4 more lines to print the receives:\n```\nwhile True:\n oldest_stream_data_from_stream_buffer = binance_websocket_api_manager.pop_stream_data_from_stream_buffer()\n if oldest_stream_data_from_stream_buffer:\n print(oldest_stream_data_from_stream_buffer)\n```\n\n### Convert received raw webstream data into well-formed python dictionaries with [UnicornFy](https://github.com/unicorn-data-analysis/unicorn_fy):\n```\nunicorn_fied_stream_data = UnicornFy.binance_com_websocket(oldest_stream_data_from_stream_buffer)\n```\nThats it! \n\n## Description\nThe python module [UNICORN Binance WebSocket API](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api) \nprovides an API to the Binance Websocket API`s of [Binance](https://github.com/binance-exchange/binance-official-api-docs) \n, [Binance Jersey](https://github.com/binance-jersey/binance-official-api-docs/), \n[Binance US](https://github.com/binance-us/binance-official-api-docs), \n[Binance DEX](https://docs.binance.org/api-reference/dex-api/ws-connection.html) and \n[Binance DEX Testnet](https://docs.binance.org/api-reference/dex-api/ws-connection.html) and supports the streaming of \nall public streams like trade, kline, ticker, depth and blockheight and also all private userData streams which needs \nto be used with a valid api_key and api_secret from the Binance Exchange \n[www.binance.com](https://www.binance.com/userCenter/createApi.html), \n[www.binance.je](https://www.binance.je/userCenter/createApi.html) or \n[www.binance.us](https://www.binance.us/userCenter/createApi.html) - for the DEX you need a user address from \n[www.binance.org](https://www.binance.org/en/create) or [testnet.binance.org](https://testnet.binance.org/en/create) \nand you can [get funds](https://www.binance.vision/tutorials/binance-dex-funding-your-testnet-account) for the testnet.\n\nThe module requires python 3.5.3 or above, as it depends on pythons latest asyncio features for asynchronous/concurrent \nprocessing. The current dependencies are listed \n[here](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/blob/master/requirements.txt).\n\nBe aware that the Binance websocket API just offers to receive data. If you would like to set orders, withdraws and so \non, you have to use the Binance Rest API ([com](https://github.com/binance-exchange/binance-official-api-docs), \n[je](https://github.com/binance-jersey/binance-official-api-docs/), \n[us](https://github.com/binance-us/binance-official-api-docs/), \n[org](https://docs.binance.org/api-reference/dex-api/paths.html)) in combination. \n\n### What are the benefits of the UNICORN Binance WebSocket API?\n- Fully managed websockets and 100% auto-reconnect!\n- Supported exchanges: \n * [Binance](https://www.binance.com) `BinanceWebSocketApiManager(exchange=\"binance.com\")`\n * [Binance Jersey](https://www.binance.je) `BinanceWebSocketApiManager(exchange=\"binance.je\")`\n * [Binance US](https://www.binance.us) `BinanceWebSocketApiManager(exchange=\"binance.us\")`\n * [Binance DEX](https://www.binance.org) `BinanceWebSocketApiManager(exchange=\"binance.org\")`\n * [Binance DEX testnet](https://testnet.binance.org) `BinanceWebSocketApiManager(exchange=\"binance.org-testnet\")`\n\n- Streams are processing asynchronous/concurrent (python asyncio) and each stream is started in a separate thread.\n- No use of the twisted module, so you can use this lib in a daemonized application (compatible with \n[python-daemon](https://pypi.org/project/python-daemon/)).\n- If you can not store your data in cause of a temporary technical issue, you can kick back the data to the \nstream_buffer which stores the receives in the RAM till you are able to process the data in the normal way again.\n- Compatible with [UnicornFy](https://github.com/unicorn-data-analysis/unicorn_fy) to convert received raw data from\ncrypto API endpoints into well-formed python dictionaries. \n- Helpful management features like `get_binance_api_status()`, `get_stream_info()`, `get_stream_list()`, \n`get_stream_statistic()`, `is_websocket_uri_length_valid()`, `replace_stream()`, `wait_till_stream_has_started()`, \n`get_current_receiving_speed()` and many more, explore them \n[here](https://www.unicorn-data.com/unicorn-binance-websocket-api.html#binance_websocket_api_docu).\n- [Monitoring API service](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/wiki/UNICORN-Monitoring-API-Service) \nand a [check_command](https://github.com/unicorn-data-analysis/check_unicorn_monitoring_api.py) \nfor [ICINGA](https://exchange.icinga.com/bithon/check_unicorn_monitoring_api)/Nagios \n![icinga2-demo](https://s3.gifyu.com/images/icinga2-unicorn_binance_websocket_api.png)\n- Excessively tested on Linux, Mac and Windows\n\nIf you like the project, please ![star](https://s3.gifyu.com/images/stard237b3003af9f9a9.png) it on \n[GitHub](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api)! If you use the\n[UNICORN Binance WebSocket API](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api) in your project,\n let us know on Twitter [@unicorn_data](https://twitter.com/unicorn_data)!\n\n## Installation and Upgrade\nPlease note: UnicornFy is not longer part of this package, visit https://github.com/unicorn-data-analysis/unicorn_fy for\nfurther information.\n### A wheel of the latest release with PIP from [PyPI](https://pypi.org/project/unicorn-binance-websocket-api/)\n`pip install unicorn-binance-websocket-api --upgrade`\n### From source of the latest release with PIP from [Github](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api)\n#### Linux, macOS, ...\nRun in bash:\n\n`pip install https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/archive/$(curl -s https://api.github.com/repos/unicorn-data-analysis/unicorn-binance-websocket-api/releases/latest | grep -oP '\"tag_name\": \"\\K(.*)(?=\")').tar.gz --upgrade`\n#### Windows\nUse the below command with the version (such as 1.3.8) you determined \n[here](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/releases/latest):\n\n`pip install https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/archive/1.3.8.tar.gz --upgrade`\n### From the latest source (dev-stage) with PIP from [Github](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api)\nThis is not a release version and can not be considered to be stable!\n\n`pip install https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/tarball/master --upgrade`\n\n### [Conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html), [Virtualenv](https://virtualenv.pypa.io/en/latest/) or plain [python](https://docs.python.org/2/install/)\nDownload the [latest release](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/releases/latest) \nor the [current master branch](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/archive/master.zip)\n and use:\n- ./environment.yml\n- ./requirements.txt\n- ./setup.py\n\n## Demo\nhttps://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/blob/master/dev_test_full_non_stop.py\n\n![demo_gif](https://s3.gifyu.com/images/unicorn-binance-websocket-api_demo_1.6.1.gif)\n\n## Howto\n- [Howto: UNICORN Binance WebSocket API](https://www.unicorn-data.com/blog/article-details/howto-unicorn-binance-websocket-api.html)\n- [Howto: Monitoring UNICORN Binance WebSocket API Manager with ICINGA2](https://www.unicorn-data.com/blog/article-details/howto-monitoring-unicorn-binance-websocket-api-manager-with-icinga2.html)\n\n## Documentation\nhttps://www.unicorn-data.com/unicorn-binance-websocket-api.html\n\n## Source, Downloads, Examples, ...\nhttps://github.com/unicorn-data-analysis/unicorn-binance-websocket-api\n\n## Change Log\nhttps://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/blob/master/CHANGELOG.md\n\n## Wiki\nhttps://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/wiki\n\n## Receive Notifications\nTo receive notifications on available updates you can ![watch](https://s3.gifyu.com/images/github_watch.png) the \nrepository on [GitHub](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api), write your \n[own script](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/blob/master/example_version_of_this_package.py) \nwith using `binance_websocket_api_manager.is_update_availabe()` or you use the \n[monitoring API service](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/wiki/UNICORN-Monitoring-API-Service).\n\nTo receive news (like inspection windows/maintenance) about the Binance API`s subscribe to their telegram groups: \n- https://t.me/binance_api_announcements\n- https://t.me/binance_api_english\n- https://t.me/Binance_Jersey\n- https://t.me/Binance_USA\n- https://t.me/BinanceDEXchange\n\n## How to report Bugs or suggest Improvements?\n[List of planned features](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) - \nclick ![thumbs-up](https://s3.gifyu.com/images/tu.png) if you need one of them or suggest a new feature!\n\nBefore you report a bug, [try the latest release](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api#installation-and-upgrade). If the issue still exists, provide the error trace, OS \nand python version and explain how to reproduce the error. A demo script is appreciated.\n\nIf you dont find an issue related to your topic, please open a new issue:\nhttps://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/issues\n\n[Report a security bug!](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/security/policy)\n\n## Contributing\n[UNICORN Binance WebSocket API](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api) is an open \nsource project which welcomes contributions which can be anything from simple documentation fixes to new features. To \ncontribute follow \n[this guide](https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/blob/master/CONTRIBUTING.md).\n\nWe ![love](https://s3.gifyu.com/images/heartae002231c41d8a80.png) open source!\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://www.unicorn-data.com", "keywords": "unicorn-data-analysis,binance,asyncio,async,asynchronous,concurrent,websocket-api,webstream-api,binance-websocket,binance-webstream,webstream,websocket,api,binance-jersey,binance-dex", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "unicorn-binance-websocket-api", "package_url": "https://pypi.org/project/unicorn-binance-websocket-api/", "platform": "", "project_url": "https://pypi.org/project/unicorn-binance-websocket-api/", "project_urls": { "Documentation": "https://www.unicorn-data.com/unicorn-binance-websocket-api.html", "Homepage": "https://www.unicorn-data.com", "Howto": "https://www.unicorn-data.com/blog/article-details/howto-unicorn-binance-websocket-api.html", "Source": "https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api", "Wiki": "https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/wiki" }, "release_url": "https://pypi.org/project/unicorn-binance-websocket-api/1.7.0/", "requires_dist": [ "colorama", "pathlib", "requests", "websocket-client", "websockets (==7.0)", "flask-restful", "cheroot", "flask" ], "requires_python": ">=3.5.3", "summary": "A python API to use the Binance Websocket API in a easy, fast, flexible, robust and fully-featured way.", "version": "1.7.0" }, "last_serial": 5941257, "releases": { "1.7.0": [ { "comment_text": "", "digests": { "md5": "e8432354cc3c4657c8469bd49cea5b0d", "sha256": "168aa6a71f7f5f6bee11a6fbafa41659ecb310bd536e5b9babd537201af18702" }, "downloads": -1, "filename": "unicorn_binance_websocket_api-1.7.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e8432354cc3c4657c8469bd49cea5b0d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 32148, "upload_time": "2019-10-07T20:22:41", "url": "https://files.pythonhosted.org/packages/ba/b3/8f8efa29e226d86d467a941d2b5c1d5d5884e24dc8dc2b0a27e8feb21176/unicorn_binance_websocket_api-1.7.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e8432354cc3c4657c8469bd49cea5b0d", "sha256": "168aa6a71f7f5f6bee11a6fbafa41659ecb310bd536e5b9babd537201af18702" }, "downloads": -1, "filename": "unicorn_binance_websocket_api-1.7.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e8432354cc3c4657c8469bd49cea5b0d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 32148, "upload_time": "2019-10-07T20:22:41", "url": "https://files.pythonhosted.org/packages/ba/b3/8f8efa29e226d86d467a941d2b5c1d5d5884e24dc8dc2b0a27e8feb21176/unicorn_binance_websocket_api-1.7.0-py3-none-any.whl" } ] }