etherscan.io api的非正式包装

pyetherscan的Python项目详细描述


……图片::https://travis-ci.org/marto32/pyeterscan.svg?branch=master
:目标:https://travis ci.org/marto32/pyeterscan

…图片::https://workalls.io/repos/github/marto32/pyeterscan/badge.svg?branch=master
:目标:https://coveralls.io/github/marto32/pyetherscan?分支=主

…图片::https://img.shields.io/pypi/pyversions/pyethscan.svg
:目标:https://pypi.python.org/pypi/pyethscan

…图片::https://img.shields.io/pypi/v/pyethscan.svg
:目标:https://pypi.python.org/pypi/pyethscan




pyethscan
==
ethscan的非正式包装<;https://ethscan.io>;` api.

安装
===
我们建议您在新的“虚拟环境”中安装此库,lt;http://python guide pt br.readthedocs.io/en/latest/dev/virtualenvs/>;` ` `.

若要安装,请创建新的“etherscan帐户”<;https://etherscan.io>;` ` ` ` ` ` ` ` `,并记下您的api密钥。然后运行以下命令安装库:

…代码块::python



安装后,设置api密钥有两种主要方法。第一个
是通过创建名为`.pyeterscan.ini``的配置文件并将其保存在主目录中。此文件的格式如下:

…代码块:none

[凭据]
etherscan-api-key:yourapikeytoken

第二个是通过设置环境变量“etherscan-api-key”`.


图书馆的使用方法。第一种是通过“client”对象与“etherscan api”直接交互,https://etherscan.io/api>;` `.

。代码块::python

in[1]:从pyethscan导入客户机


in[2]:client=client()


in[3]:address='0xde0b295669fd93d5f28d9ec85e40f4cb697bae'

in[4]:address_balance=client.get_single_balance(address)


in[5]:address_balance.response_status_code
out[5]:200


in[6]:address_balance.message
out[6]:'ok'


in[7]:address_balance.balance
out[7]:748997604382925139479303


第二个是使用完全抽象api的“pyetrscan”对象。这些
对象可以在``pyeterscan.ethereum``模块中找到,包括:

-``transaction``
-``address`
-``block`
-``token`

,例如:

。代码块::python

in[1]:从pyetherscan导入地址

in[2]:地址='0xde0b295669fd93d5f28d9ec85e40f4cb697bae'


in[3]:以太坊地址=地址(地址)

in[4]:以太坊地址。balance
out[4]:7489976043829251394793303.0


in[4]:用于txn in以太坊地址。事务:
…:打印(txn.value)

图片::https://badges.gitter.im/pyethscan/lobby.svg
:alt:加入聊天,网址是https://gitter.im/pyethscan/lobby
:target:https://gitter.im/pyethscan/lobby?联合技术手册来源=徽章和联合技术手册媒介=徽章和联合技术手册活动=公关徽章和联合技术手册内容=徽章



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

推荐PyPI第三方库


热门话题
创建名为securityConfig的bean时发生java错误。自动连线依赖项的AdminSecurityConfiguration注入失败   java如何对ListView中的每个位置执行不同的操作?   java如何在没有spring的javax验证约束验证器中注入bean   java Android设备(galaxy note 2除外)无法获取UDP数据包   java如何将JScrollbar的拇指更改为自定义图像   java正在寻找具有高效查找和磁盘持久性的字符串键映射   java在发布时收到401错误代码:从maven build执行   java Spring引导JPQL不适用于特定条件   带有文件传输和混合加密的java聊天客户端服务器   java注入鼠标侦听器无法使用ASM   使用enum作为id的java   java将进程调用放在“始终在顶部”,或者如果调用时不总是在顶部?