Hands-On Bitcoin Programming with Python
eBook - ePub

Hands-On Bitcoin Programming with Python

Build powerful online payment centric applications with Python

Harish Kumar Garg

Condividi libro
  1. 90 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Hands-On Bitcoin Programming with Python

Build powerful online payment centric applications with Python

Harish Kumar Garg

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Simplified Python programming for Bitcoin and blockchain

Key Features

  • Build Bitcoin applications in Python with the help of simple examples
  • Mine Bitcoins, program Bitcoin-enabled APIs and transaction graphs, and build trading bots
  • Analyze Bitcoin transactions and produce visualizations using Python data analysis tools

Book Description

Bitcoin is a cryptocurrency that's changing the face of online payments. Hands-On Bitcoin Programming with Python teaches you to build software applications for mining and creating Bitcoins using Python.

This book starts with the basics of both Bitcoin and blockchain and gives you an overview of these inherent concepts by showing you how to build Bitcoin-driven applications with Python. Packed with clear instructions and practical examples, you will learn to understand simple Python coding examples that work with this cryptocurrency.

By the end of the book, you'll be able to mine Bitcoins, accept Bitcoin payments on the app, and work with the basics of blockchain technology to create simply distributed ledgers.

What you will learn

  • Master the Bitcoin APIs in Python to manipulate Bitcoin from your Python apps
  • Build your own Bitcoin trading bots to buy Bitcoins at a lower price and sell them at a higher price
  • Write scripts to process Bitcoin payments through a website or app
  • Develop software for Bitcoin mining to create Bitcoin currency on your own computer hardware
  • Create your own keys, addresses, and wallets in Python code
  • Write software to analyze Bitcoin transactions and produce reports, graphs, and other visualizations

Who this book is for

Hands-On Bitcoin Programming with Python consists of examples that will teach you to build your own Bitcoin application. You will learn to write scripts, build software for mining, and create Bitcoins using Python. Anyone with prior Python experience, who wants to explore Python Bitcoin programming and start building Bitcoin-driven Python apps, will find this book useful.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Hands-On Bitcoin Programming with Python è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Hands-On Bitcoin Programming with Python di Harish Kumar Garg in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatique e Programmation en Python. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2018
ISBN
9781789533163
Edizione
1
Argomento
Informatique

Bitcoin Data Analysis

In this chapter, we will explore the manipulation and visualization of bitcoin price data using Python. We will also explore bitcoin transaction graphs, along with collecting and analyzing Bitcoin Dice game data using Python.

Manipulating and visualizing bitcoin price data

In this section, we will introduce the following topics:
  • Getting set up for data analysis
  • Getting, reading in, and cleaning bitcoin price data
  • Exploring, manipulating, and visualizing the cleaned-up data
We first need to install several Python libraries, which includes installing the pandas module for reading in data, and also doing some exploratory analysis. We'll also be installing matplotlib for creating plots and charts, as well as Jupyter Notebooks, as they are the best for this kind of work involving data analysis.

Getting set up for data analysis

To install the Python modules, open the command-line program. In the command line, to install pandas, execute the following command:
pip install pandas
Similarly, to install matplotlib, execute the following command:
pip install matplotlib
To install Jupyter, execute the following command:
pip install jupyter
Having finished installing the required modules, launch the Jupyter Notebook by executing the jupyter notebook command. This will open up a new browser window, or a tab, where it will display the list of files that are already there from the folder where we executed the jupyter notebook command. The following screenshot shows the jupyter notebook command:
Next, choose to create a new Python 3 notebook, as shown in the following screenshot:

Getting, reading in, and cleaning bitcoin price data

We will start by importing the necessary modules.
Import pandas to enable you to read in the data and start exploring it. The following screenshot shows the import pandas command:
Also, import matplotlib for drawing plots from the data.
We need to set some options for pandas and matplotlib. The following screenshot shows the command for importing matplotlib:
The first option we will set is called options.mode.chained_assignment = None.
The preceding option is to make sure that the operations are for the cleanup, which will be performed on the pandas DataFrame objects; we want the cleanup to happen on the original DataFrame objects and not on copies.
The following screenshot shows the options.mode.chained_assignment = None option:
Also, set matplotlib to visualize and display all the charts shown in the following screenshot:
The price data we have is from coindesk.com, as shown in the following screenshot, and it is freely available for download:
Download the data in CSV format and read this data using pandas. This is a CSV file, so we will use the read_CSV method from pandas, as shown in the following screenshot:

DataFrame

The data in a pandas data object is called a DataFrame. A DataFrame is in a tabular data format. Now, print out some records to see how this looks. To print this out, we can call a method called head() on the price DataFrame.
When we do this, we get two columns—Date and Close Price—for the bitcoin in USD for that day. We also have a default index for the rows starting from 0, which was inserted by pandas by default while reading in the data. The following screenshot shows the two columns, Date and Close Price...

Indice dei contenuti