Skip to content

Instantly share code, notes, and snippets.

@badmofo
badmofo / bitstamp.py
Last active June 27, 2017 15:30
bitstamp.py
import hmac
import hashlib
import requests
import time
import json
import re
import arrow
from decimal import Decimal
def to_bytes(s):
@badmofo
badmofo / btc_to_btcp.py
Created April 27, 2018 08:34
convert bitcoin addr to bitcoin private addr
import bitcoin
def btc_to_btcp(addr):
assert addr[0] in ('1', '3') # we don't support bech32 addrs for now
addr_prefix = b'\x13\x25' if addr[0] == '1' else b'\x13\xaf'
pkh = bitcoin.b58check_to_bin(addr)
assert len(pkh) == 20
return bitcoin.bin_to_b58check(addr_prefix[1:2] + pkh, addr_prefix[0])
from ofxparse import OfxParser
import sys
import csv
with open(sys.argv[1]) as f:
ofx = OfxParser.parse(f)
account = ofx.account
statement = account.statement
institution = account.institution
@badmofo
badmofo / coinlist.py
Last active September 23, 2023 20:37
CoinList Pro Python3 API
'''
Copyright (c) 2020 Lucas Ryan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so.