The block target in Bitcoin is encoded in block headers as a 24 bit integer raised to an 8 bit exponent:

int(nBits[1:4]) * 2 ** (8 * (int(nBits[0]) - 3))