Generate a json file from an OpenDocument Format .ods file
Project description
Generate a json file from an OpenDocument Format .ods file.
When used as a script, odsparsator parses an .ods file and generates a json file using the odfdo library.
When used as a library, odsparsator parses an .ods file and returns a python structure.
The resulting data follows the format of the reverse odsgenerator.py script, see https://github.com/jdum/odsgenerator
installation
$ pip install odsparsator
usage
odsparsator [-h] [--version] [options] input_file output_file
arguments
input_file: input file, a .ods file.
output_file: output file, json file generated from input.
Use odsparsator --help for more details about options.
sample
$ odsparsator --minimal sample.ods sample_minimal.json
The result:
{
"body": [
{
"name": "first tab",
"table": [
["a", "b", "c"],
[10, 20, 30]
]
}
]
}
Without the –minimal option:
$ odsparsator sample.ods sample_with_styles.json
The result:
{
"body": [
{
"name": "first tab",
"table": [
{
"row": [
{
"value": "a",
"style": "bold_center_bg_gray_grid_06pt"
},
{
"value": "b",
"style": "bold_center_bg_gray_grid_06pt"
...
from python code
import odsparsator
content = odsparsator.ods_to_python("sample1.ods")
documentation
See in the doc folder:
html/odsparsator.html
license
This project is licensed under the MIT License (see the LICENSE file for details).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for odsparsator-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69309fd539100d08385eafb52b7e2aa9545742f3d3668e964138784c9e5f0584 |
|
MD5 | 78ed78ec31421624f2320583d8bf5530 |
|
BLAKE2b-256 | 1178e18f4b62e4612217bbfcedb917912f958cd1ab0ab5757d18eefa18bd03a3 |