Skip to main content

odsparsator, a .ods parser.

Generate a JSON file from an OpenDocument Format .ods file.

When used as a script, odsparsator parses a .ods file and generates a JSON file using the odfdo library.

When used as a library, odsparsator parses a .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

odsparsator is a Python package, using the odfdo library. Current version requires Python >= 3.10, see prior versions for older environments.

Project: https://github.com/jdum/odsparsator

Author: jerome.dumonteil@gmail.com

License: MIT

Installation

Installation from Pypi (recommended):

pip install odsparsator

Installation from sources:

uv sync

CLI 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 options:

options:
  -h, --help         show this help message and exit
  --version          show program's version number and exit
  -m, --minimal      keep only rows and cells, no styles, no formula, no column width
  -a, --all-styles   collect all styles from the input
  -c, --color        collect background color of cells
  -k, --keep-styled  keep styled cells with empty value
  -s, --see-hidden   parse also the hidden sheets

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"
                        ...

Usage from python code

from odsparsator 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).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odsparsator-1.15.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odsparsator-1.15.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file odsparsator-1.15.0.tar.gz.

File metadata

  • Download URL: odsparsator-1.15.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for odsparsator-1.15.0.tar.gz
Algorithm Hash digest
SHA256 15c972aba68dcf0bb941605020cb8a775454ab0c3719986a23580327378cdb82
MD5 330ca9d9a6b6c7af51b3fa1b72f964de
BLAKE2b-256 2f4dd9e18ee831026a9c4dd93c9879d4fa80fbb98e632e788845ac9ca4d6a0ec

See more details on using hashes here.

File details

Details for the file odsparsator-1.15.0-py3-none-any.whl.

File metadata

  • Download URL: odsparsator-1.15.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for odsparsator-1.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9125c2b35de0957d594e746e361059d1f6efd3068bb1776589b3f3a38c1133a6
MD5 21878ac8955f386155a30f6db7d33488
BLAKE2b-256 298c8dba43d7148262a0241a8a199bf671e605d397c4febddbb739634a477c74

See more details on using hashes here.

Release history Release notifications | RSS feed

1.16.0

2 files

This release

1.15.0 This release

2 files

1.14.0

2 files

1.13.1

2 files

1.13.0

2 files

1.12.2

2 files

1.12.1

2 files

1.12.0

2 files

1.11.0

2 files

1.10.0

2 files

1.9.0

2 files

1.8.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

3 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page