Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Bitcoin Programming with Python

You're reading from   Hands-On Bitcoin Programming with Python Build powerful online payment centric applications with Python

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher
ISBN-13 9781789537000
Length 90 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Harish Garg Harish Garg
Author Profile Icon Harish Garg
Harish Garg
Arrow right icon
View More author details
Toc

Installing the Blockchain.info Python library

The following are the steps to install the blockchain Python library:

  1. Open the command-line program on your computer.
  2. Run the pip install blockchain command to install the blockchain library.

The following screenshot shows the installation of bitcoin:

Getting bitcoin exchange rates from Blockchain.info

The following steps shows the method for bitcoin exchange rates:

  1. First, import the exchangerates classes from the blockchain library:
#!/usr/bin/env python

# import blockchain library
from blockchain import exchangerates
  1. Exchange rates define a get_ticker method, which returns the exchange rates data in a dictionary object. Call this method and save the resulting object. The...
You have been reading a chapter from
Hands-On Bitcoin Programming with Python
Published in: Aug 2018
Publisher:
ISBN-13: 9781789537000
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime