Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dxsooo/pymsofficeconverter
Microsoft office files(.doc/.xls/.ppt etc) converter by Python
https://github.com/dxsooo/pymsofficeconverter
Last synced: 1 day ago
JSON representation
Microsoft office files(.doc/.xls/.ppt etc) converter by Python
- Host: GitHub
- URL: https://github.com/dxsooo/pymsofficeconverter
- Owner: dxsooo
- Created: 2015-10-06T13:06:46.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-15T02:32:24.000Z (about 9 years ago)
- Last Synced: 2023-08-10T09:35:10.389Z (over 1 year ago)
- Language: Python
- Size: 160 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PyMSofficeConverter
## Overview
Microsoft office files(.doc/.xls/.ppt etc) converter written in Python.
Recently supports* Microsoft word document convert between **.doc** and **.docx**
* Microsoft excel workbook convert between **.xls** and **.xlsx**
* Microsoft powerpoint presentation convert between **.ppt** and **.pptx**## Requirements
* Python 2.7
* Windows 7 or above
* Microsoft Office 2013 or above
* [pywin32](http://sourceforge.net/projects/pywin32/)## Documentation
Copy the `MSofficeConverter.py` to current directory or under `site-packages` of your python.
And then
```python
from MSofficeConverter import easy_converteasy_convert('x:/test.doc','x:/test.docx')
# full path of file, here convert test.doc to test.docx
```
Also, you can use a class to do this, but please remember to call `quit()` when your work is over.
```python
from MSofficeConverter import converterxx=converter('PPT') # the file type you are going to convert, accept 'PPT','DOC','XLS'
xx.convert('x:/test.pptx','x:/tst.ppt')
# xx.convert('x:/tst.ppt','x:/test2.pptx') # you can do more before you quitxx.quit() # must do this
```
It is strongly recommanded that if you are dealing with a quantity of files, you should use the `converter` class and set a loop to call `convert()` instead of `easy_convert()`.