odsparsator


Nameodsparsator JSON
Version 1.10.0 PyPI version JSON
download
home_pagehttps://github.com/jdum/odsparsator
SummaryGenerate a json file from an OpenDocument Format .ods file
upload_time2024-03-24 14:47:09
maintainerNone
docs_urlNone
authorJérôme Dumonteil
requires_python<4,>=3.9
licenseMIT
keywords opendocument odf ods json spreadsheet parser
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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 `Python3` package, using the [odfdo](https://github.com/jdum/odfdo) library. Current version requires Python >= 3.9, see prior versions for older environments.

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

Author:
    jerome.dumonteil@gmail.com

License:
    MIT


## Installation

Installation from Pypi (recommended):


```python
pip install odsparsator
```

Installation from sources (requiring setuptools):

```python
pip install .
```

## 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

```


### sample
------

```sh
$ odsparsator --minimal sample.ods sample_minimal.json
```

The result:

```python
{
    "body": [
        {
            "name": "first tab",
            "table": [
                ["a", "b", "c"],
                [10, 20, 30]
            ]
        }
    ]
}
```

Without the --minimal option:

```sh
$ odsparsator sample.ods sample_with_styles.json
```

The result:

```python

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


```python
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).


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jdum/odsparsator",
    "name": "odsparsator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.9",
    "maintainer_email": null,
    "keywords": "openDocument, ODF, ods, json, spreadsheet, parser",
    "author": "J\u00e9r\u00f4me Dumonteil",
    "author_email": "jerome.dumonteil@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e7/cf/9b132e834f1cd8f8a3d6d8bda423db959c8f435ee42c26abbe8abf1be8ef/odsparsator-1.10.0.tar.gz",
    "platform": null,
    "description": "# odsparsator, a .ods parser.\n\nGenerate a JSON file from an OpenDocument Format `.ods` file.\n\nWhen used as a script, `odsparsator` parses a `.ods` file and generates a JSON\nfile using the `odfdo` library.\n\nWhen used as a library, `odsparsator` parses a `.ods` file and returns a Python\nstructure.\n\nThe resulting data follows the format of the reverse `odsgenerator.py` script,\nsee https://github.com/jdum/odsgenerator\n\n\n`odsparsator` is a `Python3` package, using the [odfdo](https://github.com/jdum/odfdo) library. Current version requires Python >= 3.9, see prior versions for older environments.\n\nProject:\n    https://github.com/jdum/odsparsator\n\nAuthor:\n    jerome.dumonteil@gmail.com\n\nLicense:\n    MIT\n\n\n## Installation\n\nInstallation from Pypi (recommended):\n\n\n```python\npip install odsparsator\n```\n\nInstallation from sources (requiring setuptools):\n\n```python\npip install .\n```\n\n## CLI usage\n\n```\nodsparsator [-h] [--version] [options] input_file output_file\n```\n\n### arguments\n\n`input_file`: input file, a .ods file.\n\n`output_file`: output file, JSON file generated from input.\n\nUse ``odsparsator --help`` for options:\n\n```\noptions:\n  -h, --help         show this help message and exit\n  --version          show program's version number and exit\n  -m, --minimal      keep only rows and cells, no styles, no formula, no column width\n  -a, --all-styles   collect all styles from the input\n  -c, --color        collect background color of cells\n  -k, --keep-styled  keep styled cells with empty value\n\n```\n\n\n### sample\n------\n\n```sh\n$ odsparsator --minimal sample.ods sample_minimal.json\n```\n\nThe result:\n\n```python\n{\n    \"body\": [\n        {\n            \"name\": \"first tab\",\n            \"table\": [\n                [\"a\", \"b\", \"c\"],\n                [10, 20, 30]\n            ]\n        }\n    ]\n}\n```\n\nWithout the --minimal option:\n\n```sh\n$ odsparsator sample.ods sample_with_styles.json\n```\n\nThe result:\n\n```python\n\n{\n\"body\": [\n    {\n        \"name\": \"first tab\",\n        \"table\": [\n            {\n                \"row\": [\n                    {\n                        \"value\": \"a\",\n                        \"style\": \"bold_center_bg_gray_grid_06pt\"\n                    },\n                    {\n                        \"value\": \"b\",\n                        \"style\": \"bold_center_bg_gray_grid_06pt\"\n                        ...\n```\n\n\n## Usage from python code\n\n\n```python\nimport odsparsator\n\ncontent = odsparsator.ods_to_python(\"sample1.ods\")\n```\n\n\n## Documentation\n\nSee in the `./doc` folder:\n\n\n`html/odsparsator.html`\n\n\n## License\n\nThis project is licensed under the MIT License (see the\n`LICENSE` file for details).\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Generate a json file from an OpenDocument Format .ods file",
    "version": "1.10.0",
    "project_urls": {
        "Homepage": "https://github.com/jdum/odsparsator",
        "Repository": "https://github.com/jdum/odsparsator"
    },
    "split_keywords": [
        "opendocument",
        " odf",
        " ods",
        " json",
        " spreadsheet",
        " parser"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8aac814881661db1f6b4ec8a9328ad96b7f589aac9623071cc9f61167bae8635",
                "md5": "1195f7db7ed6c43cb732583596689ead",
                "sha256": "cfdf5849909a7cf7d1950139afa057e3e43a4d3718ceffac00a1488ad142a5e1"
            },
            "downloads": -1,
            "filename": "odsparsator-1.10.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1195f7db7ed6c43cb732583596689ead",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.9",
            "size": 8559,
            "upload_time": "2024-03-24T14:47:08",
            "upload_time_iso_8601": "2024-03-24T14:47:08.046165Z",
            "url": "https://files.pythonhosted.org/packages/8a/ac/814881661db1f6b4ec8a9328ad96b7f589aac9623071cc9f61167bae8635/odsparsator-1.10.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e7cf9b132e834f1cd8f8a3d6d8bda423db959c8f435ee42c26abbe8abf1be8ef",
                "md5": "2c70501792e96f4dbd105e8f46ccca49",
                "sha256": "1342a73ac2e29f2fb353fab5a60343c80822640ce19e11c59d8ac04f24a713dd"
            },
            "downloads": -1,
            "filename": "odsparsator-1.10.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2c70501792e96f4dbd105e8f46ccca49",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.9",
            "size": 8533,
            "upload_time": "2024-03-24T14:47:09",
            "upload_time_iso_8601": "2024-03-24T14:47:09.904693Z",
            "url": "https://files.pythonhosted.org/packages/e7/cf/9b132e834f1cd8f8a3d6d8bda423db959c8f435ee42c26abbe8abf1be8ef/odsparsator-1.10.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-24 14:47:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jdum",
    "github_project": "odsparsator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "odsparsator"
}
        
Elapsed time: 0.21357s