官术网_书友最值得收藏!

  • Learning Python for Forensics
  • Preston Miller Chapin Bryce
  • 277字
  • 2021-08-20 10:17:13

Working with Serialized Data Structures

In this chapter, we'll develop greater skills while working with nested lists and dictionaries by manipulating JavaScript Object Notation (JSON) structured data. Our artifact of interest is raw Bitcoin account data that contains, among other things, a list of all sent and received transactions. We'll access this dataset using a web Application Programming Interface (API) and parse it in a manner conducive to analysis.

APIs are created for software products and allow programmers to interface with the software in defined ways. Publicly accessible APIs aren't always available for the given software. When available, they expedite code development by offering methods to interact with the software, as the APIs will handle lower-level implementation details. Developers implement APIs to encourage others to build supporting programs and, additionally, control the manner in which other developers' code interacts with their software. By creating an API, developers are giving other programmers a controlled manner of interfacing with their program.

In this chapter, we'll use the web API from https://www.blockchain.info to query and receive Bitcoin account information for a given Bitcoin address. The JSON data that this API generates can be converted into Python objects using the JSON module from the standard library. Instructions and examples of their API can be found at https://www.blockchain.info/api/blockchain_api.

In this chapter, we'll cover the following:

  • Discussing and manipulating serialized structures including Extensible Markup Language (XML) and JSON data
  • Creating logs with Python
  • Reporting results in a CSV output format
The code for this chapter was developed and tested using Python 2.7.15 and Python 3.7.1. The bitcoin_address_lookup.v1.py and bitcoin_address_lookup.v2.py scripts were developed to work with Python 3.7.1 and not Python 2.7.15.
主站蜘蛛池模板: 青岛市| 安远县| 淮安市| 邢台市| 乐安县| 云梦县| 玛纳斯县| 安乡县| 赤壁市| 来安县| 清远市| 新巴尔虎左旗| 罗城| 常熟市| 安康市| 禄劝| 宁蒗| 阿拉善盟| 淄博市| 白沙| 民县| 长兴县| 安图县| 昭觉县| 孝感市| 繁昌县| 丁青县| 米易县| 大厂| 达日县| 房产| 海晏县| 聂拉木县| 浏阳市| 深圳市| 绥滨县| 花垣县| 纳雍县| 衢州市| 苗栗市| 阜南县|