Hi @Ahmed. Here's a sample code that reads the data from a json file, converts it into a string and then encrypt:
import json
from Cryptodome.Cipher import AES
with open('path_to_file/filename.json') as f:
text=json.dumps(f)
key = '0123456789abcdef'
IV='0123456789abcdef'
mode = AES.MODE_CBC
encryptor = AES.new(key.encode('utf8'), mode,IV=IV.encode('utf8'))
ciphertext = encryptor.encrypt(text)