Skip to content

Repository files navigation

bitcoin-blockchain-parser Build StatusCoverage Status

This Python 3 library provides a parser for the raw data stored by bitcoind.

Features

  • Detects outputs types
  • Detects addresses in outputs
  • Interprets scripts

Examples

importsysfromblockchain_parser.blockchainimportBlockchain# Instanciate the Blockchain by giving the path to the directory # containing the .blk files created by bitcoindblockchain=Blockchain(sys.argv[1])
forblockinblockchain.get_unordered_blocks():
fortxinblock.transactions:
forno, outputinenumerate(tx.outputs):
print("tx=%s outputno=%d type=%s value=%s"% (tx.hash, no, output.type, output.value))

More examples are available in the examples directory.

Installing

Requirements : python-bitcoinlib, coverage for tests

To install, just run

python setup.py install

Tests

Run the test suite by lauching

./tests.sh

About

A Python 3 Bitcoin blockchain parser

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages