# odfdo
[![Release](https://img.shields.io/github/v/release/jdum/odfdo)](https://img.shields.io/github/v/release/jdum/odfdo)
[![Build Status](https://img.shields.io/github/actions/workflow/status/jdum/odfdo/main.yml?branch=devel)](https://img.shields.io/github/actions/workflow/status/jdum/odfdo/main.yml?branch%3Adevel)
[![License](https://img.shields.io/github/license/jdum/odfdo)](https://img.shields.io/github/license/jdum/odfdo)
[![PyPI Downloads](https://static.pepy.tech/badge/odfdo/month)](https://pepy.tech/projects/odfdo)
Python library for OpenDocument format (ODF)
![logo](https://raw.githubusercontent.com/jdum/odfdo/master/odfdo.png)
`odfdo` is a Python3 library implementing the ISO/IEC 26300 OpenDocument Format
standard.
Project:
https://github.com/jdum/odfdo
Author:
jerome.dumonteil@gmail.com
License:
Apache License, Version 2.0
`odfdo` is a derivative work of the former `lpod-python` project.
# Installation
Installation from Pypi (recommended):
```python
pip install odfdo
```
Installation from sources (requiring setuptools):
```python
pip install .
```
After installation from sources, you can check everything is working (some requirements: `pytest`, Pillow, ...):
```python
pytest
```
The tests should run for a few seconds or minutes and issue no error.
The full test suite uses `tox` to check different `Python` and `lxml` versions.
A special effort is made to limit the dependencies of this library: the only dependency (outside development) is `lxml`. The `lxml` versions depend mainly on the version of Python used, see the `pyproject.toml` file for details.
# Usage
from odfdo import Document, Paragraph
doc = Document('text')
doc.body.append(Paragraph("Hello world!"))
doc.save("hello.odt")
# tl;dr
'Intended Audience :: Developers'
# Documentation
There is no detailed documentation or tutorial, but:
- the `recipes` folder contains more than 60 working sample scripts,
- the `doc` folder contains an auto generated HTML documentation, including recipes.
When installing odfdo, a few scripts are installed:
- `odfdo-diff`: show a _diff_ between two .odt document.
- `odfdo-folder`: convert standard ODF file to folder and files, and reverse.
- `odfdo-show`: dump text from an ODF file to the standard output, and optionally styles and meta informations.
- `odfdo-styles`: command line interface tool to manipulate styles of ODF files.
- `odfdo-replace`: find a pattern (regex) in an ODF file and replace by some string.
- `odfdo-userfield`: show or set the user-field content in an ODF file.
- `odfdo-highlight`: highlight the text matching a pattern (regex) in an ODF file.
- `odfdo-headers`: print the headers of an ODF file.
- `odfdo-table-shrink`: shrink tables to optimize width and height.
- `odfdo-markdown`: export text document in Markdown format to stdout.
About styles: the best way to apply style is by merging styles from a template
document into your generated document (See `odfdo-styles` script).
Styles are a complex matter in ODF, so trying to generate styles programmatically
is not recommended.
# Limitations
`odfdo` is intended to facilitate the generation of ODF documents,
nevertheless a basic knowledge of the ODF format is necessary.
ODF document rendering can vary greatly from software to software. Especially the
"styles" of the document allow an adaptation of the rendering for a particular
software.
The best (only ?) way to apply style is by merging styles from a template
document into your generated document. However a few recipes show how to make
programmatically some basic styles: `create_basic_text_styles`, `add_text_span_styles`).
# Related project
I you work on `.ods` files (spreadsheet), you may be interested by these scripts using
this library to parse/generate `.ods` files:
`https://github.com/jdum/odsgenerator` and `https://github.com/jdum/odsparsator`
# Changes from former lpod library
`lpod-python` was written in 2009-2010 as a Python 2.x library,
see: `https://github.com/lpod/lpod-python`
`odfdo` is an adaptation of this former project. `odfdo` main changes from `lpod`:
- `odfdo` requires Python version 3.9 to 3.13. For previous Python versions see older releases.
- API change: more pythonic.
- include recipes.
- use Apache 2.0 license.
Raw data
{
"_id": null,
"home_page": "https://github.com/jdum/odfdo",
"name": "odfdo",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.9",
"maintainer_email": null,
"keywords": "python, library, ODF, OpenDocument",
"author": "J\u00e9r\u00f4me Dumonteil",
"author_email": "jerome.dumonteil@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/89/49/ae6f38fd331e8a5d5059c14e702a0a6e8435f1d2be645e9cb26f865b409e/odfdo-3.13.2.tar.gz",
"platform": null,
"description": "# odfdo\n\n[![Release](https://img.shields.io/github/v/release/jdum/odfdo)](https://img.shields.io/github/v/release/jdum/odfdo)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/jdum/odfdo/main.yml?branch=devel)](https://img.shields.io/github/actions/workflow/status/jdum/odfdo/main.yml?branch%3Adevel)\n[![License](https://img.shields.io/github/license/jdum/odfdo)](https://img.shields.io/github/license/jdum/odfdo)\n[![PyPI Downloads](https://static.pepy.tech/badge/odfdo/month)](https://pepy.tech/projects/odfdo)\n\nPython library for OpenDocument format (ODF)\n\n![logo](https://raw.githubusercontent.com/jdum/odfdo/master/odfdo.png)\n\n`odfdo` is a Python3 library implementing the ISO/IEC 26300 OpenDocument Format\nstandard.\n\nProject:\nhttps://github.com/jdum/odfdo\n\nAuthor:\njerome.dumonteil@gmail.com\n\nLicense:\nApache License, Version 2.0\n\n`odfdo` is a derivative work of the former `lpod-python` project.\n\n# Installation\n\nInstallation from Pypi (recommended):\n\n```python\npip install odfdo\n```\n\nInstallation from sources (requiring setuptools):\n\n```python\npip install .\n```\n\nAfter installation from sources, you can check everything is working (some requirements: `pytest`, Pillow, ...):\n\n```python\npytest\n```\n\nThe tests should run for a few seconds or minutes and issue no error.\n\nThe full test suite uses `tox` to check different `Python` and `lxml` versions.\n\nA special effort is made to limit the dependencies of this library: the only dependency (outside development) is `lxml`. The `lxml` versions depend mainly on the version of Python used, see the `pyproject.toml` file for details.\n\n# Usage\n\n from odfdo import Document, Paragraph\n\n doc = Document('text')\n doc.body.append(Paragraph(\"Hello world!\"))\n doc.save(\"hello.odt\")\n\n# tl;dr\n\n'Intended Audience :: Developers'\n\n# Documentation\n\nThere is no detailed documentation or tutorial, but:\n\n- the `recipes` folder contains more than 60 working sample scripts,\n- the `doc` folder contains an auto generated HTML documentation, including recipes.\n\nWhen installing odfdo, a few scripts are installed:\n\n- `odfdo-diff`: show a _diff_ between two .odt document.\n- `odfdo-folder`: convert standard ODF file to folder and files, and reverse.\n- `odfdo-show`: dump text from an ODF file to the standard output, and optionally styles and meta informations.\n- `odfdo-styles`: command line interface tool to manipulate styles of ODF files.\n- `odfdo-replace`: find a pattern (regex) in an ODF file and replace by some string.\n- `odfdo-userfield`: show or set the user-field content in an ODF file.\n- `odfdo-highlight`: highlight the text matching a pattern (regex) in an ODF file.\n- `odfdo-headers`: print the headers of an ODF file.\n- `odfdo-table-shrink`: shrink tables to optimize width and height.\n- `odfdo-markdown`: export text document in Markdown format to stdout.\n\nAbout styles: the best way to apply style is by merging styles from a template\ndocument into your generated document (See `odfdo-styles` script).\nStyles are a complex matter in ODF, so trying to generate styles programmatically\nis not recommended.\n\n# Limitations\n\n`odfdo` is intended to facilitate the generation of ODF documents,\nnevertheless a basic knowledge of the ODF format is necessary.\n\nODF document rendering can vary greatly from software to software. Especially the\n\"styles\" of the document allow an adaptation of the rendering for a particular\nsoftware.\n\nThe best (only ?) way to apply style is by merging styles from a template\ndocument into your generated document. However a few recipes show how to make\nprogrammatically some basic styles: `create_basic_text_styles`, `add_text_span_styles`).\n\n# Related project\n\nI you work on `.ods` files (spreadsheet), you may be interested by these scripts using\nthis library to parse/generate `.ods` files:\n`https://github.com/jdum/odsgenerator` and `https://github.com/jdum/odsparsator`\n\n# Changes from former lpod library\n\n`lpod-python` was written in 2009-2010 as a Python 2.x library,\nsee: `https://github.com/lpod/lpod-python`\n\n`odfdo` is an adaptation of this former project. `odfdo` main changes from `lpod`:\n\n- `odfdo` requires Python version 3.9 to 3.13. For previous Python versions see older releases.\n- API change: more pythonic.\n- include recipes.\n- use Apache 2.0 license.\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Python library for OpenDocument Format",
"version": "3.13.2",
"project_urls": {
"Homepage": "https://github.com/jdum/odfdo",
"Repository": "https://github.com/jdum/odfdo"
},
"split_keywords": [
"python",
" library",
" odf",
" opendocument"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8241f256b26c0090abe13d3051144148b749f0636e0d9903994ac766218bcc2f",
"md5": "0b0c5c909a240f075ce6741e6612904d",
"sha256": "4e81dfc974a23b9eca9c742fcdb95d80d7927571944b241b371e4a7143116ddb"
},
"downloads": -1,
"filename": "odfdo-3.13.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0b0c5c909a240f075ce6741e6612904d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.9",
"size": 249458,
"upload_time": "2024-12-15T14:59:51",
"upload_time_iso_8601": "2024-12-15T14:59:51.668673Z",
"url": "https://files.pythonhosted.org/packages/82/41/f256b26c0090abe13d3051144148b749f0636e0d9903994ac766218bcc2f/odfdo-3.13.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8949ae6f38fd331e8a5d5059c14e702a0a6e8435f1d2be645e9cb26f865b409e",
"md5": "7835d24aaeb39bb9bf40fcb67bc79d98",
"sha256": "4b5aa9ddf76c18edeb883d6f79524f4a6939bfd609c8194e231015f6e8779cf5"
},
"downloads": -1,
"filename": "odfdo-3.13.2.tar.gz",
"has_sig": false,
"md5_digest": "7835d24aaeb39bb9bf40fcb67bc79d98",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.9",
"size": 197578,
"upload_time": "2024-12-15T14:59:54",
"upload_time_iso_8601": "2024-12-15T14:59:54.982397Z",
"url": "https://files.pythonhosted.org/packages/89/49/ae6f38fd331e8a5d5059c14e702a0a6e8435f1d2be645e9cb26f865b409e/odfdo-3.13.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-15 14:59:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jdum",
"github_project": "odfdo",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "odfdo"
}