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

Compartir libro
  1. 90 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Hands-On Bitcoin Programming with Python

Build powerful online payment centric applications with Python

Harish Kumar Garg

Detalles del libro
Vista previa del libro
Índice
Citas

Información del 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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Hands-On Bitcoin Programming with Python un PDF/ePUB en línea?
Sí, puedes acceder a Hands-On Bitcoin Programming with Python de Harish Kumar Garg en formato PDF o ePUB, así como a otros libros populares de Informatique y Programmation en Python. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2018
ISBN
9781789533163
Edición
1
Categoría
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...

Índice