how do i insert few row in an existing excel file using python? the excel file maybe be of any excel version. On windows that could have been possible by using win32com.client...but i need to make the changes in the linux environment. how can i do it?
you can use pyExcelerator. the package comes with example demos to write excel files
I'm looking into this myself and found https://bitbucket.org/ericgazoni/openpyxl/wiki/Home .
It is a new library that allows editing xlsx files.
Related
I've been scrolling for a while but couldn't find a solution or advice to my particular problem. I'm new to Python and to pandas module/model testing, and I started studying machine learning and predictive time series recently.
I'm currently using python and pandas on Windows Powershell and Visual Studio Code. I have an RRD database exported from a virtual linux machine, from which i should take the data (it only has a date and value columns) to create and validate a model. The thing is that pandas doesn't read RRD files, and its XML file has a weird format. This is what i already tried:
-Installing RRDTool from pip to make a script to save the data to a CSV: kept getting errors regarding RRDTool libraries and header. If i go over to https://oss.oetiker.ch/rrdtool/ like the error suggests, last downloadable Cygwin Windows version is really old (2005 and 2007). Is rrdtool deprecated from windows?
-Trying some scripts from here to open XML files and parse through its code: failled because rrd xml file has a weird format to match rrd file.
-Trying to manually adapt the xml file to be parsable: this file has over 50000 rows and i would need to do this again in the future, so it is not desirable.
Also i read that there are pearl scripts for rrd2csv but also require rrd installed (and i don't know pearl).
Is there any way to export a rrd to csv on python - windows? or should I abandon it and try to do it on python - linux, for example?
Thanks for your time reading this.
I have an .xlsx file I generate using xlsxwriter in a python script (version 2.7). I am trying to find a way to convert a worksheet in the file to a PDF format. I have not found a module that suits my needs yet.. simple, lightweight, and is able to be installed using pip.
Any suggestions, let's hear them! Thanks to all!
Try using a comdination of openpyxl and PDFwriter as shown in this example this example
I've been looking for ways to do this and haven't found a good solution to this. I'm trying to copy a sheet in an .xlsx file that has macros to another workbook. I know I could do this if the sheet contained data in each cell but that's not the case. The sheet contains checkboxes and SOME text. Is there a way to do this in python (or any other language for that matter?) I just need it done programmatically as it will be part of a larger script.
Try win32com package.
This offers an interface of VBA for python
You can find it on SourceForge.
I've done some projects with this package, we can discuss more on your problem if this package helps.
Is there any existing Python library that can validate data in Excel format? Or what kind of keyword should I use to search such an open source project? Thanks.
[Disclosure: I'm the author of xlrd]
xlrd allows you to extract data from XLS files. XLSX support is in alpha testing; e-mail me if you need it. You get told precisely what is in each cell (Excel cell type and value). It runs on Python 2.1 to 2.7 on any platform. You don't need Windows. You don't need Excel to be installed on your machine. Start with the tutorial found here.
I`m not sure what are you looking for, but there are three libraries that, in combination, can read and write excel files:
xlrd
xlwt
xlutils
They read and save binary excel archives both in windows and linux. There are functions for formatting data and styles.
If you want to check if some data column is in a given format you can do it with these libs (basically with xlrd).
I have some data in CSV format that I want to pull into an Excel spreadsheet and then create some standard set of graphs for. Since the data is originally generated in a Python app, I was hoping to simply extend the app so that it could do all the post processing and I wouldn't have to do it by hand. Is there an easy interface with Python to work with and manipulate Excel spreadsheets? Any good samples of doing this? Is this Windows only (I'm primarily working on a Mac and have Excel, but could do this on Windows if necessary).
xlutils (and the included packages xlrd and xlwt) should allow your Python program to handily do any creation, reading and manipulation of Excel files you might want!
On Windows you could use the pywin32 package to create an Excel COM Object and then manipulate it from a script. You need to have an installed Excel on that machine though. I haven't done this myself so I can't give you and details but I've seen this working so can at least confirm that it's possible. No idea about OS X, unfortunately.