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.1.0.tar.gz (830.5 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.1.0-py3-none-any.whl (849.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unogenerator-1.1.0.tar.gz
  • Upload date:
  • Size: 830.5 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.1.0.tar.gz
Algorithm Hash digest
SHA256 4bcf35fd662bedf467e1755b6e9bbc9a5fdd2f7f7e727a5129a0310cd2fbd31d
MD5 ab538e19b8c48db7e6db33f5ced89d9d
BLAKE2b-256 f0ee59d5a5f2aace11ab069e23c91c80c69d2323a5ebb6338b7a67e864ffd222

See more details on using hashes here.

File details

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

File metadata

  • Download URL: unogenerator-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 849.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 159c517d93f308a274a635e851c338d9f5564f88bb3eb684307f934a7993973a
MD5 c8aef249c7c3ce2c2dd62848491fffa3
BLAKE2b-256 4a89ca6bf1836af535cff855922d98968e12ea2fb3a5af79e9632c4712e391eb

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