How to Convert XLSX to JSON in Python

When working with data and spreadsheets, Excel is often seen as the most user-friendly platform for accomplishing your goals. However, spreadsheets in the XLSX file format cannot be easily translated to an online format, which might be necessary when collaborating or sharing information with multiple groups. The following API will allow you to convert XLSX documents to JSON for improved online usage of your data.

To use this API, run this command to install the SDK:

pip install cloudmersive-convert-api-client

Then, you can call the function:

from __future__ import print_function
import time
import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_convert_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# create an instance of the API class
api_instance = cloudmersive_convert_api_client.ConvertDataApi(cloudmersive_convert_api_client.ApiClient(configuration))
input_file = '/path/to/inputfile' # file | Input file to perform the operation on.
try:
# Convert Excel XLSX to JSON conversion
api_response = api_instance.convert_data_xlsx_to_json(input_file)
pprint(api_response)
except ApiException as e:
print("Exception when calling ConvertDataApi->convert_data_xlsx_to_json: %s\n" % e)

You can retrieve the API Key from Cloudmersive at no cost and with no commitment. This will give you access to 800 monthly calls across our library of APIs.

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.