How to Convert ODS to XLSX in Python

Having access to free, easy-to-use software like the OpenOffice platform will help fill the gap that might otherwise be caused by an application paywall. Through this platform, applications like Excel can be exchanged for the free OpenDocument Spreadsheets (ODS) program. After creating your ODS file using this more cost-effective option, you can use the following API to convert it to the more widely accepted and compatible XLSX.

Image for post
Image for post

To use this API, you can 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.ConvertDocumentApi(cloudmersive_convert_api_client.ApiClient(configuration))
input_file = '/path/to/inputfile' # file | Input file to perform the operation on.
try:
# Convert ODS Spreadsheet to XLSX
api_response = api_instance.convert_document_ods_to_xlsx(input_file)
pprint(api_response)
except ApiException as e:
print("Exception when calling ConvertDocumentApi->convert_document_ods_to_xlsx: %s\n" % e)

The API Key for this function can be retrieved at no cost and with no commitment on the Cloudmersive website. This will give you access to 800 monthly calls across our entire API library.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store