Microsoft Office - Excel¶
Read and write Microsoft Excel files, and integrate your code with other products from the Microsoft Office suite.
Tip
This plugin doesn't require you to have Microsoft Office or Microsoft Excel installed.
Installation¶
Importing the Plugin¶
After you installed this package, the next step is to import the package into your code and start using the functions.
Instantiating the Plugin¶
To make the example we will instantiate the plugin.
Manipulating spreadsheet data¶
Now, let's manipulate some data from our file, adding new data, sorting and writing the result to a new file.
Complete code¶
Let's take a look into the complete code:
from botcity.plugins.excel import BotExcelPlugin
# Instantiate the plugin
bot_excel = BotExcelPlugin()
# Read from an Excel File
bot_excel.read('read.xlsx')
# Add a row
bot_excel.add_row([0, 22])
# Sort it by columns A and B in descending order
bot_excel.sort(['A', 'B'], False)
# Print the result
print(bot_excel.as_list())
# Save it to a new file
bot_excel.write('write.xlsx')