How can I test if a bitcoin address is compressed or not? I have two bitcoin addresses:

1D8VSXHFAWNhAbruwUMbNp4hsXAnRNkYvX
12T15tvMGaymMX97X9KxVzyLF323r8v6Hg


One is compressed, one is not.

How can I test which is which? (Preferably using python 2.7)

Thanks in advance :)
You cannot determine (from only a base58check address) if the corresponding public key is compressed.

A "normal" pay-to-public-key-hash (P2PKH) is a cryptographic hash of either a compressed or an uncompressed public key. Because hashes cannot be feasibly reversed, you cannot tell if the public key, before being hashed, was compressed or uncompressed.

More specifically, a public key in Bitcoin is a pair integers (x,y). For uncompressed public keys, these integers are encoded as 256-bit unsigned big-endian ints, concatenated together, and then prepended with a single 0x04 byte. The result is 65 bytes long.

For compressed public keys, only the x coordinate is encoded (like above, as 256-bit unsigned big-endian int). It turns out that the y coordinate can only be one of two values, one even and one odd. Instead of prepending a single 0x04 byte, a single 0x02 or 0x03 byte is prepended depending on y's value (0x02 for even, 0x03 for odd). The result is 33 bytes long.

Finally, these bytes (from one of the two paragraphs above) go through the address conversion process described here in the bitcoin.org Developer Guide, which includes taking an irreversible cryptographic hash (actually, two hashes).

Note that in order to redeem a UTXO associated with a P2PKH address, the redeemer must create a transaction which includes the unhashed public key, either compressed or uncompressed. If such a tx exists in the blockchain, it can be connected to its "normal" base58check address. This is one of the reasons why address reuse is discouraged: once you redeem a UTXO, you "reveal" your public key, which is slightly more sensitive than your bitcoin address.