Interact with Bitcoin Blockchain directly using Python (Part 1)

in #cryptocurrencies7 years ago (edited)

There is a library in python for blockchain which you can interact with Bitcoin Blockchain directly using Blockchain.info API:

1- Installing The Blockchain Package:

pip install blockchain

2- Adding exchange module:

from blockchain import exchangerates

3- Iterate exchange rates:

rates = exchangerates.get_ticker()
for r in rates:
    print r, rates[k].last

The output is as follows:

PLN 33996.01
TWD 289581.75
GBP 7221.0
CNY 65624.75
CHF 9463.44
INR 621673.88
CAD 12259.46
NZD 13970.86
ISK 991664.96
AUD 12663.7
BRL 31071.6
KRW 10490324.09
HKD 75343.46
THB 314941.51
SGD 12983.99
JPY 1080834.1
EUR 8086.77
SEK 79957.99
USD 9657.82
RUB 561667.26
DKK 60148.97
CLP 6128852.57
In [41]:

These prices have many features including: last, buy, sell, and symbol. So you will be able to interact with the network in a whole new way.

Bitcoin-Value-Graph3.png

We will investigate more stuffs in the next parts.

Sort:  

Hello ! I just read your content, I love it. Follow me @osmanie and I follow you too!

Hi, Thanks, I started follow you too.

Coin Marketplace

STEEM 0.20
TRX 0.14
JST 0.030
BTC 63774.40
ETH 3406.49
USDT 1.00
SBD 2.59