I implemented bip39 support, because I think it would be a useful addition to pybitcointools.
The code is inside the bitcoin.mnemonic module. For ease of use, I also included the text file for the default english wordlist, but if you want you can remove this from the repo.
I tried to closely mimic the style of pybitcointools.
For example, you can do
seed=bitcoin.mnemonic_to_seed('grocery toilet zone hill key replace second thought question canoe capable organ million tackle drip',passphrase='TREZOR')
print(hexlify(seed))
I implemented bip39 support, because I think it would be a useful addition to pybitcointools.
The code is inside the bitcoin.mnemonic module. For ease of use, I also included the text file for the default english wordlist, but if you want you can remove this from the repo.
I tried to closely mimic the style of pybitcointools.
For example, you can do
To get the output
You can also generate words from an entropy source mnemonic.entropy_to_words, or verify a checksum with mnemonic.words_verify