def deserialize_transaction(tx_hex):

    tx = bitcoin.deserialize(str(tx_hex))

    inputs = tx["ins"]
    outputs = tx["outs"]

    ret_inputs = []
    ret_outputs = []

    for inp in inputs:
        ret_inp = {
            "transaction_hash": inp["outpoint"]["hash"],
            "output_index": int(inp["outpoint"]["index"]),
        }

        if "sequence" in inp:
            ret_inp["sequence"] = int(inp["sequence"])

        if "script" in inp:
            ret_inp["script_sig"] = inp["script"]

        ret_inputs.append(ret_inp)

    for out in outputs:
        ret_out = {
            "value": out["value"],
            "script_hex": out["script"]
        }

        ret_outputs.append(ret_out)

    return ret_inputs, ret_outputs, tx["locktime"], tx["version"]
Given a serialized transaction, return its inputs, outputs,
dataset/ETHPy150Open blockstack/pybitcoin/pybitcoin/transactions/serialize.py/deserialize_transaction