Skip to main content

将从加密交换 API 端点接收到的原始数据转换为格式良好的 python 字典。

项目描述

GitHub 发布 GitHub 下载 康达发布 康达下载 PyPi 发布 皮皮下载 执照 支持的 Python 版本 PyPI - 状态 语言等级:Python 警报总数 单元测试 Azure 管道 编解码器 阅读文档 Github 电报

独角兽

支持的交易所| 安装| 更改日志| 文档| 示例| 维基| 社会| 通知| 错误| 贡献| 商业支持

将从加密交换 API 端点接收到的原始数据转换为格式良好的 python 字典。

'UNICORN Binance Suite' 的一部分。

import unicorn_fy

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}}

unicornfy = unicorn_fy.UnicornFy()

unicorn_fied_stream_data = unicornfy.binance_com_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.11.1']}

此库集成到 UNICORN Binance WebSocket API 中,可以通过设置 to参数或output_default使用to 参数BinanceWebSocketApiManager()UnicornFyoutput针对create_stream()UnicornFy 特定流 激活。

获取正确的记录器

logging.getLogger("unicorn_fy")

支持的交易所

网络套接字

交换 文档 地位
币安API binance_com_websocket(stream_data_json) 稳定的
币安测试网API binance_com_websocket(stream_data_json) 稳定的
币安保证金API binance_com_margin_websocket(stream_data_json) 稳定的
币安保证金测试网API binance_com_margin_websocket(stream_data_json) 稳定的
币安逐仓保证金API binance_com_isolated_margin_websocket(stream_data_json) 稳定的
币安逐仓保证金测试网API binance_com_isolated_margin_websocket(stream_data_json) 稳定的
币安期货API binance_com_futures_websocket(stream_data_json) 稳定的
币安期货测试网API binance_com_futures_websocket(stream_data_json) 稳定的
币安币期货API binance_com_coin_futures_websocket(stream_data_json) NEEDS_YOUR_HELP
币安币期货测试网API binance_com_coin_futures_websocket(stream_data_json) NEEDS_YOUR_HELP
币安泽西( API ) binance_je_websocket(stream_data_json) 稳定的
币安美国API binance_us_websocket(stream_data_json) 稳定的
币安TRAPI trbinance_com_websocket(stream_data_json) 稳定的
币安 JEX ( API ) jex_com_websocket(stream_data_json) 稳定的
币安 DEX ( API ) binance_org_websocket(stream_data_json) NEEDS_YOUR_HELP
币安 DEX 测试网( API ) binance_org_websocket(stream_data_json) NEEDS_YOUR_HELP

休息

  • 没有任何

如果你喜欢这个项目,请 星星GitHub 上

安装和升级

该模块需要 Python 3.6.0 或更高版本。

当前的依赖项在此处列出 。

如果您在安装过程中遇到错误,请查看此处

pip来自PyPI的最新版本的轮子和源文件

pip install unicorn-fy --upgrade

conda来自Anaconda通过CONDA-FORGE的最新版本的conda 包。

conda install -c conda-forge unicorn-fy

conda update -c conda-forge unicorn-fy

来自Github的带有 PIP 的最新版本的来源

Linux, macOS, ...

在 bash 中运行:

pip install https://github.com/LUCIT-Systems-and-Development/unicorn-fy/archive/$(curl -s https://api.github.com/repos/lucit-systems-and-development/unicorn-fy/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")').tar.gz --upgrade

视窗

将以下命令与您在此处确定的版本(例如 0.7.0)一起使用:

pip install https://github.com/LUCIT-Systems-and-Development/unicorn-fy/archive/0.7.0.tar.gz --upgrade

来自Github的带有 PIP 的最新源(开发阶段)

这不是发布版本,不能认为是稳定的!

pip install https://github.com/LUCIT-Systems-and-Development/unicorn-fy/tarball/master --upgrade

Conda 环境Virtualenv或纯Python

下载最新版本当前主分支 并使用:

  • ./environment.yml
  • ./requirements.txt
  • ./setup.py

更改日志

https://unicorn-fy.docs.lucit.tech//CHANGELOG.html

文档

例子

项目主页

https://github.com/LUCIT-Systems-and-Development/unicorn-fy

维基

https://github.com/LUCIT-Systems-and-Development/unicorn-fy/wiki

社会的

接收通知

要接收有关可用更新的通知,您可以 手表GitHub 上的存储库中, 使用 using 编写您 自己的脚本is_update_available(), 或者使用 监控 API 服务

在TwitterFacebook上关注我们,了解有关unicorn-binance-suite的一般新闻!

如何报告错误或提出改进建议?

计划功能列表-竖起大拇指如果您需要其中一项或建议新功能,请单击!

在您报告错误之前,请尝试最新版本。如果问题仍然存在,请提供错误跟踪、操作系统和 python 版本,并说明如何重现错误。演示脚本表示赞赏。

如果您没有找到与您的主题相关的问题,请打开一个新问题: https ://github.com/LUCIT-Systems-and-Development/unicorn-fy/issues

报告安全漏洞!

贡献

UnicornFy 是一个开源项目,它欢迎任何贡献,从简单的文档修复和报告死链接到新功能。要做出贡献,请遵循 本指南

贡献者

贡献者

我们爱开源!

商业支持

路西特

您需要开发人员、运营商或顾问吗?

通过我在维也纳(奥地利)的公司LUCIT或通过Telegram与联系以进行不具约束力的初步咨询 。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

unicorn-fy-0.12.2.tar.gz (22.3 kB 查看哈希

已上传 source

内置分布

unicorn_fy-0.12.2-py3-none-any.whl (18.4 kB 查看哈希

已上传 py3