License and Readme and update dependencies.
This commit is contained in:
parent
8dd4cbf912
commit
d9a449d256
4 changed files with 60 additions and 3 deletions
39
README.md
Normal file
39
README.md
Normal file
|
@ -0,0 +1,39 @@
|
|||
ods2md
|
||||
======
|
||||
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
|
||||
|
||||
Convert LibreOffice Calc Spreadsheets (*.ods) into Markdown tables
|
||||
|
||||
![Sample output](sample.png)
|
||||
|
||||
Install
|
||||
-------
|
||||
|
||||
1. Get Python 3.
|
||||
|
||||
2. (Optional) Create a virtual environment.
|
||||
|
||||
```sh
|
||||
python3 -m venv env
|
||||
. env/bin/activate
|
||||
```
|
||||
|
||||
3. Install `ezodf` for parsing *.ods files
|
||||
|
||||
```sh
|
||||
pip3 -r requirements.txt
|
||||
```
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
```sh
|
||||
./ods2md.py input_file.ods > output_file.md
|
||||
```
|
||||
|
||||
Limitations
|
||||
-----------
|
||||
|
||||
* This program disregards all formats. Currencies and percentages will be displayed as plain numbers.
|
||||
* Merged cells are not supported, the content will be shown at the first cell (this is actually a limitation of GFM table)
|
20
ods2md.py
20
ods2md.py
|
@ -1,8 +1,26 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2015, 2017 Kenny Chan
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all copies or
|
||||
# substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
||||
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
||||
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import ezodf
|
||||
import sys
|
||||
import html
|
||||
import unicodedata
|
||||
|
||||
# Ref: http://stackoverflow.com/a/31666966/224671
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
ezodf==0.3.0
|
||||
lxml==3.4.4
|
||||
ezodf==0.3.2
|
||||
lxml==3.7.2
|
||||
|
|
BIN
sample.png
Normal file
BIN
sample.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
Loading…
Reference in a new issue