code: def compress_json(data):
      
      json_string = json.dumps(data).encode('utf-8', 'ignore').decode('utf-8')
      # JSON.parse() doesn't handle `NaN`, but it does handle `null`.
      json_string = json_string.replace('NaN', 'null');
      x = lzstring.LZString()
      return x.compressToBase64(json_string)
docs: Take a Python data object. Convert to JSON and compress using lzstring