I search a bit and found a python code that can convert bech32 to hash160 I don't if this is the exact script you looking for but read this
Thaks a lot🙏
Quote from: https://bitcoin.stackexchange.com/questions/90644/most-efficient-way-to-store-segwit-address-in-a-database
Quote from: Question
Is there a way to get to the hash160 address from bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c
Code:
import bech32
f = open("addresses.txt", "r")
for line in f:
hash1 = bech32.decode("bc", line.strip())
try:
hash2 = bytes(hash1[1])
open('hash160.txt', 'a').write(hash2.hex() + '\n')
except:
print('False:', line.strip())
pass
f.close()