Skip to main content

Libreoffice files generator programmatically with python and Libreoffice server instances

Project description

UnoGenerator PyPI - Downloads Github - Downloads Tests

Description

Python module to generate Libreoffice documents (ODT and ODS) programatically.

Morever, you can export them to (.xlsx, .docx, .pdf) easyly.

It uses Libreoffice uno module, so you need Libreoffice to be installed in your system.

Installation

Only Linux is supported. I'm going to write unogenerator installation methods for some main Linux Distributions

ODT 'Hello World' example

This is a Hello World example. You get the example in odt, docx and pdf formats:

from unogenerator import ODT_Standard
with ODT_Standard() as doc:
  doc.addParagraph("Hello World", "Heading 1")
  doc.addParagraph("Easy, isn't it","Standard")
  doc.save("hello_world.odt")
  doc.export_docx("hello_world.docx")
  doc.export_pdf("hello_world.pdf")

ODS 'Hello World' example

This is a Hello World example. You'll get example files in ods, xlsx and pdf formats:

from unogenerator import ODS_Standard
with ODS_Standard() as doc:
  doc.addCellMergedWithStyle("A1:E1", "Hello world", style="BoldCenter")
  doc.save("hello_world.ods")
  doc.export_xlsx("hello_world.xlsx")
  doc.export_pdf("hello_world.pdf")

Unogenerator scripts

Python unogenerator package has the following scripts:

unogenerator_monitor

Monitors your libreoffice server instances

unogenerator_translation

With this tool you can translate several odt files with one command. It generates .pot and .po files, where you can set your translations. Then run your command again and you'll get your files translated

unogenerator_translation --from_language es --to_language en --input original.odt --input original2.odt --output_directory "translation_original"

You can use --fake to see simulation of your translation

unogenerator_demo

With this tool you can generate a demo, remove its result files and make benchmark comparations in your system

Documentation

You can read documentation in doc directory. It has been created with unogenerator.

Development links

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

unogenerator-1.2.0.tar.gz (830.9 kB view details)

Uploaded Source

Built Distribution

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

unogenerator-1.2.0-py3-none-any.whl (849.8 kB view details)

Uploaded Python 3

File details

Details for the file unogenerator-1.2.0.tar.gz.

File metadata

  • Download URL: unogenerator-1.2.0.tar.gz
  • Upload date:
  • Size: 830.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.13.13 Linux/7.0.0-gentoo

File hashes

Hashes for unogenerator-1.2.0.tar.gz
Algorithm Hash digest
SHA256 4ae59be3d6d1c031d75343448f69b9af04760f94dae56ef30aeb3d50266cbfaf
MD5 899a9fd87d7269da0b9175a45789bef8
BLAKE2b-256 2d962f74cbb7aceb9aad9f52a7021616643f826538c1d6397c952138970bb387

See more details on using hashes here.

File details

Details for the file unogenerator-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: unogenerator-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 849.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.13.13 Linux/7.0.0-gentoo

File hashes

Hashes for unogenerator-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62d3941f088199a7cdcf3261fe2aaa603fd6cc6d2adca345ca5a0de1d20af693
MD5 6dba4a644c219d72b1a927734a9945f9
BLAKE2b-256 c75f908a5b72218163386f1cb1d06a1f2fd52a8092f8664fa5c14c86b564d34e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page