The first iteration of our script will focus primarily on ingesting and processing the data appropriately. In this script, we will print out transaction summaries for the account to the console. In later iterations, we will add logging and outputting data to a CSV file:
001 import argparse 002 import json 003 import urllib2 004 import unix_converter as unix 005 import sys 006 007 __author__ = 'Preston Miller & Chapin Bryce' 008 __date__ = '20160401' 009 __version__ = 0.01 010 __description__ = 'This scripts downloads address transactions using blockchain.info public APIs'
We will use five modules in the initial version of the script. The argparse
, json
, urllib2
, and sys
modules are all part of the standard library. The unix_converter
module is the mostly unmodified script that we wrote in Chapter 2, Python Fundamentals, and is used here to convert Unix timestamps in the Bitcoin transaction data. Both argparse
and urllib2
have been used...