how to get eth_signTypedDataV4 signature in web3.py
EIP712 signatures can generated using the https://eth-account.readthedocs.io/en/stable/eth_account.html#eth_account.messages.encode_structured_data function to encode the EIP712 message, and use web3 to sign it.
msg = { "types":
{ "EIP712Domain": [], "Type": []},
"domain":domain,
"primaryType": 'Type',
"message":message }
encoded_data=encode_structured_data(msg)
web3.eth.account.sign_message(encoded_data,privateKey)