user1829: I have made paper wallets. And I continually send what bitcoins I get to them. I'm paranoid that I've been sending bitcoins to the paper bitcoin addresses where somehow at sometime my saved private keys got corrupted. So from time to time I want to run a script, python or whatever, to check if my private keys do correspond to the public address that I've been sending bitcoins to. I want an offline solution so things like the satoshi client would not do. Is there a small script written by someone that can solve this?

user1307: If I understand your problem correctly and you just want to calculate the address of a given private key, you could use brainwallet.org for that. The website is Javascript-based so you can just load the website and disconnect from the internet. 
If you want it even safer, you could download the source code and open the website locally on an offline machine. 
Brainwallet.org has quite a lot little useful address tools. 

user99: Offhand it looks like pycoin is more active thanpybitcoin. So I'll put Keir Finlow-Bates' code from a comment above into an answer by itself:
from pycoin.key import Key
k = Key.from_text("<yourWIFhere>")
k.address()


user153: Bitcoin-bash-tools has what you need.
For Python, numtowif() below, from a post by forum user flatfly, does that as well:
import hashlib, binascii

t='123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def numtowif(numpriv):
 step1 = '80'+hex(numpriv)[2:].strip('L').zfill(64)
 step2 = hashlib.sha256(binascii.unhexlify(step1)).hexdigest()
 step3 = hashlib.sha256(binascii.unhexlify(step2)).hexdigest()
 step4 = int(step1 + step3[:8] , 16)
 return ''.join([t[step4/(58**l)%58] for l in range(100)])[::-1].lstrip('1')

def wiftonum(wifpriv):
 return sum([t.index(wifpriv[::-1][l])*(58**l) for l in range(len(wifpriv))])/(2**32)%(2**256)

def validwif(wifpriv):
 return numtowif(wiftonum(wifpriv))==wifpriv

print numtowif(0x0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D)
print hex(wiftonum('5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ'))
print validwif('5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ')
print validwif('5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTK')

Also, Armory client has some C++ that can be compiled and easily accessed from Python which provides this.

user6767: I'd check out the python library PyBitcoin (https://github.com/blockstack/pybitcoin or "pip install pybitcoin").
It's pretty simple to get the address from the wif private key:
>>> from pybitcoin import BitcoinPrivateKey
>>> private_key = BitcoinPrivateKey()
>>> private_key.public_key().address()
'1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T'

You can also derive a private key object from it's raw hex representation:
>>> private_key_2 = BitcoinPrivateKey('91149ee24f1ee9a6f42c3dd64c2287781c8c57a6e8e929c80976e586d5322a3d')

P.S. This library also works with Litecoin, Namecoin and a bunch of other coins.
Disclosure: I'm one of the creators.

1829: <p>I have made paper wallets. And I continually send what bitcoins I get to them. I'm paranoid that I've been sending bitcoins to the paper bitcoin addresses where somehow at sometime my saved private keys got corrupted. So from time to time I want to run a script, python or whatever, to check if my private keys do correspond to the public address that I've been sending bitcoins to. I want an offline solution so things like the satoshi client would not do. Is there a small script written by someone that can solve this?</p>
 1307: <p>If I understand your problem correctly and you just want to calculate the address of a given private key, you could use brainwallet.org for that. The website is Javascript-based so you can just load the website and disconnect from the internet. 
If you want it even safer, you could download the source code and open the website locally on an offline machine. </p>

<p>Brainwallet.org has quite a lot little useful address tools. </p>
 99: <p>Offhand it looks like <a href="https://github.com/richardkiss/pycoin" rel="nofollow noreferrer"><code>pycoin</code></a> is more active than<code>pybitcoin</code>. So I'll put Keir Finlow-Bates' code from a comment above into an answer by itself:</p>

<pre><code>from pycoin.key import Key
k = Key.from_text("&lt;yourWIFhere&gt;")
k.address()
</code></pre>
 153: <p><a href="http://github.com/grondilu/bitcoin-bash-tools" rel="nofollow noreferrer">Bitcoin-bash-tools</a> has what you need.</p>

<p>For Python, numtowif() below, from a <a href="http://bitcointalk.org/index.php?topic=84238.msg1205204#msg1205204" rel="nofollow noreferrer">post by forum user</a> flatfly, does that as well:</p>

<pre><code>import hashlib, binascii

t='123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def numtowif(numpriv):
 step1 = '80'+hex(numpriv)[2:].strip('L').zfill(64)
 step2 = hashlib.sha256(binascii.unhexlify(step1)).hexdigest()
 step3 = hashlib.sha256(binascii.unhexlify(step2)).hexdigest()
 step4 = int(step1 + step3[:8] , 16)
 return ''.join([t[step4/(58**l)%58] for l in range(100)])[::-1].lstrip('1')

def wiftonum(wifpriv):
 return sum([t.index(wifpriv[::-1][l])*(58**l) for l in range(len(wifpriv))])/(2**32)%(2**256)

def validwif(wifpriv):
 return numtowif(wiftonum(wifpriv))==wifpriv

print numtowif(0x0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D)
print hex(wiftonum('5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ'))
print validwif('5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ')
print validwif('5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTK')
</code></pre>

<p>Also, Armory client has some C++ that can be compiled and easily <a href="http://bitcointalk.org/index.php?topic=52314.msg931524#msg931524" rel="nofollow noreferrer">accessed from Python</a> which provides this.</p>
 6767: <p>I'd check out the python library PyBitcoin (<a href="https://github.com/blockstack/pybitcoin" rel="noreferrer">https://github.com/blockstack/pybitcoin</a> or "pip install pybitcoin").</p>

<p>It's pretty simple to get the address from the wif private key:</p>

<pre><code>&gt;&gt;&gt; from pybitcoin import BitcoinPrivateKey
&gt;&gt;&gt; private_key = BitcoinPrivateKey()
&gt;&gt;&gt; private_key.public_key().address()
'1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T'
</code></pre>

<p>You can also derive a private key object from it's raw hex representation:</p>

<pre><code>&gt;&gt;&gt; private_key_2 = BitcoinPrivateKey('91149ee24f1ee9a6f42c3dd64c2287781c8c57a6e8e929c80976e586d5322a3d')
</code></pre>

<p>P.S. This library also works with Litecoin, Namecoin and a bunch of other coins.</p>

<p>Disclosure: I'm one of the creators.</p>
