将从加密交换api端点接收的原始数据转换为格式良好的python字典。
unicorn-f的Python项目详细描述
单飞
将从加密交换api端点接收的原始数据转换为格式良好的python字典。
UnicornFy是 UNICORN Binance WebSocket API但可以使用 每一个以原始格式发送接收的api(接收时没有更改)。
from unicorn_fy.unicorn_fy import UnicornFy
received_stream_data_json = {"stream": "btcusdt@trade",
"data": {"e": "trade",
"E": 1556876873656,
"s": "BTCUSDT",
"t": 117727701,
"p": "5786.76000000",
"q": "0.03200500",
"b": 341831847,
"a": 341831876,
"T": 1556876873648,
"m": True,
"M": True}}
unicorn_fied_stream_data = UnicornFy.binance_websocket(received_stream_data_json)
print(unicorn_fied_stream_data)
>>>
{'stream_type': 'btcusdt@trade', 'event_type': 'trade', 'event_time': 1556876873656, 'symbol': 'BTCUSDT', 'trade_id': 117727701, 'price': '5786.76000000', 'quantity': '0.03200500', 'buyer_order_id': 341831847, 'seller_order_id': 341831876, 'trade_time': 1556876873648, 'is_market_maker': True, 'ignore': True, 'unicorn_fied': ['binance', '0.1.0']}
当前此模块没有依赖项。
如果你喜欢这个项目,请it on GitHub!如果你使用 UnicornFylib在你的项目中,让我们在twitter上知道 @unicorn_data!
支持的交换
websockets
- binance.com(API specification)
- binance.je(API specification)
- binance.org(API specification)(计划中)
- testnet.binance.org(API specification) (计划中)
安装和升级
最新版本的轮子,pip来自PyPI
pip install unicorn-fy --upgrade
来自最新版本的源,pip来自Github
Linux、MacOS,…
在bash中运行:
pip install https://github.com/unicorn-data-analysis/unicorn-fy/archive/$(curl -s https://api.github.com/repos/unicorn-data-analysis/unicorn-fy/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")').tar.gz --upgrade
窗口
对您确定的版本(如0.2.0)使用下面的命令here:
pip install https://github.com/unicorn-data-analysis/unicorn_fy/archive/0.2.0.tar.gz --upgrade
来自最新的源(dev stage),pip来自Github
这不是一个发布版本,不能被认为是稳定的!
pip install https://github.com/unicorn-data-analysis/unicorn_fy/tarball/master --upgrade
文档
https://www.unicorn-data.com/unicorn_fy.html
来源,下载,示例,…
https://github.com/unicorn-data-analysis/unicorn_fy
更改日志
https://github.com/unicorn-data-analysis/unicorn_fy/blob/master/CHANGELOG.md
维基
https://github.com/unicorn-data-analysis/unicorn_fy/wiki
接收通知
要接收有关可用更新的通知,可以
在GitHub上存储库,编写
own script
使用unicorn_fy.is_update_availabe()
或
monitoring API service。
如何报告错误或提出改进建议?
List of planned features- 如果需要或建议使用新功能,请单击!
在报告错误之前,try the latest release。 如果问题仍然存在,请提供错误跟踪、OS和Python版本,并解释如何重现错误。 一个演示脚本是赞赏的。
如果找不到与主题相关的问题,请打开新问题: https://github.com/unicorn-data-analysis/unicorn_fy/issues
贡献
unicorn_fy是打开的 欢迎贡献的源项目,可以是从简单的文档修复到新功能的任何东西。到 贡献跟随 this guide。
我们开源!