16 Home
Mauricio Baeza edited this page 2024-03-22 10:23:53 -06:00

ZAZ

Leer en español

Develop macros and extensions for LibreOffice with Python

zaz it's a script Python for rapid develop macros in LibreOffice, with Python of course.

With zaz, you can create:

  • Extensions for final user.
  • New components for used from Basic developers.
  • AddIn, new functions for Calc.

Requirements

  • Python 3.7+
  • LibreOffice with support for macros Python
  • LibreOffice SDK, for new components and AddIn
    • For ArchLinux
      sudo pacman -S libreoffice-fresh-sdk
      

Installation

  • Clone this repository.
git clone https://git.cuates.net/elmau/zaz.git

My first extension

  • Enter folder source.
cd zaz/source
  • Make new extension.

Replace PATH for your absolute path.

python zaz.py --new -t PATH -n my-great-extension
  • For example:
python zaz.py --new -t /home/mau/ -n my-extension
07/11/2020 18:28:39 - INFO - Folders and files copy successfully for new extension.
07/11/2020 18:28:39 - INFO - Change to folder: /home/mau/my-extension
  • Then change to new folder
cd /home/mau/my-extension
  • Create
python zaz.py -c

07/11/2020 20:43:25 - INFO - Created directories...
07/11/2020 20:43:25 - INFO - Created files...
07/11/2020 20:43:25 - INFO - Don't forget generate DOMAIN.pot for locales
07/11/2020 20:43:25 - INFO - New extension: MyFirstExtension make sucesfully...
    Now, you can install and test: zaz.py -i
  • And install it
python zaz.py -i

07/11/2020 20:43:38 - INFO - Don't forget generate DOMAIN.pot for locales
07/11/2020 20:43:38 - INFO - Compress OXT extension...
07/11/2020 20:43:38 - INFO - Extension OXT created sucesfully...
Copying: MyFirstExtension_v0.1.0.oxt

unopkg done.

07/11/2020 20:43:40 - INFO - Install extension sucesfully...
07/11/2020 20:43:40 - INFO - Start LibreOffice...
07/11/2020 20:44:36 - INFO - Extension make successfully...

File conf.py

Only modify this options.

Configure correctly this options in this file, before you create your new extension.

Type extension

TYPE_EXTENSION

It's important select correctly this option.

  • Integer
    • 1 = Normal extension
    • 2 = New components
    • 3 = Calc addin

Example:

TYPE_EXTENSION = 1

Name

Your extension name, not used spaces.

NAME

  • String

Example:

NAME = 'MyExtension'

Version

VERSION

Example:

VERSION = '0.1.0'

ID extension

Internal name for your extension.

ID

  • String
    • Should be unique, used URL inverse

Example:

ID = 'org.yourname.extensionname'

Library easymacro.py

Documentation for easymacro.py

Leer en español