波纹管提取器

grapple的Python项目详细描述


https://travis-ci.org/tinybike/grapple.svg?branch=masterhttps://coveralls.io/repos/tinybike/grapple/badge.pnghttps://badge.fury.io/py/grapple.svg

抓斗通过WebSocket直接从Rippled中提取完整的Ripple分类账。它查询当前分类帐索引的Rippled,然后向后移动,直到到达Genesis分类帐,记录找到的每个事务。

可以从本地或远程涟漪实例收集数据。如果您有一个运行的本地涟漪实例已经下载了全部或大部分分类账,我强烈建议您进行本地数据收集。从Ripple的公共WebSocket获取数据非常慢!

格斗还重新采样每个货币对的价格时间序列,以创建“开放-高-低-关闭”时间序列。这些重新取样的数据集可用于统计测试、技术市场分析或简单地绘制图表。

捐款:

Bitcoin: 1NUqhGjJEedXxUSxJThfDAHzF2mFosk3fo
Ripple: ~tinybike (rLvcQ6ctvr12aQq29AcZT6JMWH7iZ8esHS)

安装

安装抓斗的最简单方法是使用pip:

pip install grapple

grapple的设计目的是使用config.py中的连接信息与postgresql集成。默认情况下,它假设您的数据库位于localhost(127.0.0.1)上,并且您的数据库的名称、密码、用户名和都是“抓斗”。

(虽然这肯定不是一个安全的设置,但对于通过pip安装grapple并且不希望编辑其源代码的人来说,这可能会很方便。)

用法

抓斗可用作python模块:

fromgrappleimportGrapplegrapple=Grapple()grapple.download()

抓斗构造函数接受以下关键字参数:

socket_url (str):
rippled websocket URL (default=”ws://127.0.0.1:6006/”)
full (bool):
True if downloading the full ledger (starting from the current ledger and walking back to the genesis ledger). False if the download should stop at the last current ledger (i.e., the last time grapple was run). (default=True)
genesis (int):
Genesis block index and download halting point. (default=152370)
quiet (bool):
If True, suppress console output. (default=True)
resampling_frequencies (tuple):
Resampling frequencies, using pandas frequency codes. If None, then resampling is disabled. (default=(‘D’,) or daily)

它也可以作为脚本运行:

python grapple.py [-flags]

可选标志:

-w, --websocket [websocket url]:
    Specify the rippled websocket url. (default=ws://127.0.0.1:6006/)

-p, --public:
    Use Ripple Labs' public websocket, wss://s1.ripple.com:51233.

-f, --full:
    Download the full Ripple ledger.  Automatic on your first run.

-g, --genesis [ledger index]:
    Genesis ledger index and download halting point.

-q, --quiet:
    Suppress command line output.

测试

单元测试在test/目录中。目前覆盖范围有限,但进展缓慢!

注意:默认情况下,将禁用需要本地涟漪和/或Postgres数据库连接的测试。有关详细信息,请参见test/test_grapple.py。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何将外部库(LIB)集成到grails项目中?   java 安卓:progressTintMode、安卓:secondaryProgressTintMode和安卓:progressDrawable做什么?   java获得了启动播放器的精确方向   java如何在布局/样式XML中设置状态栏着色颜色?   Java中的图形游戏未显示   java如何在WebSphere8.5.5中的我的JAAS自定义登录模块中使用SAML令牌属性值   使用jackson spring API解析嵌套json   java如何从用户请求中获取用户代理?   Netbeans 6.8中的java UI控件定位   java显示listgrid中两个表中的数据   java Google Cloud Bigtable客户端连接池   Vert中的java更改日志级别。通过添加一个配置文件   java调用构造函数是否意味着创建实例?   java getFrom()[0])中[0]用于获取邮件发件人地址的用法是什么   “继续”标志的java Gradle属性?   jakarta ee如何在java ee中创建GUID   java不兼容类型:无法将int转换为整数   java需要借助DefaultHandler的characters函数将XML数据读入安卓应用程序   java mapstruct将方法应用于列表中的所有对象