Skip to content

Instantly share code, notes, and snippets.

View Amourspirit's full-sized avatar

:Barry-Thomas-Paul: Moss Amourspirit

  • Hamilton, Ontario, Canada
View GitHub Profile
@Amourspirit
Amourspirit / README.md
Created May 28, 2023 16:28 — forked from Foadsf/README.md
Scripting LibreOffice with Python

This tutorial was originally written by Jannie Theunissen on onesheep.org. However, the website has been down for a while and this a clone from the web.archive.org backup. Also, the parts regarding the macOS are updated according to this post. You may find OneSheep here on Twitter and Jannie Theunissen here on StackOverflow. If you have any comments on this Gist please poke me here on Twitter, otherwise, I might miss your comments.

Scripting LibreOffice with Python

We were recently asked to automate some editing tasks for the Spotlight English editors w

@Amourspirit
Amourspirit / office.py
Last active June 10, 2023 20:04
Start the LibreOffice (FlatPak) in a virtual environment.
"""
This module is used to start the LibreOffice (FlatPak) in a virtual environment.
When this script is run, it will start the LibreOffice (FlatPak) and include
the virtual environment's site-packages directory in the PYTHONPATH.
In short when this module is included in the root of a project with a virtual environment
then the LibreOffice (FlatPak) will be able to import the project's modules installed with pip.
Usage:
python office.py [options] [app]
@Amourspirit
Amourspirit / LibrePythonista-docker-linuxserver-libreoffice.md
Last active March 28, 2025 23:25
Running LibrePythonista in linuxserver/libreoffice docker

Running LibrePythonista in linuxserver/libreoffice docker

In order to install LibrePythonista in linuxserver/libreoffice docker (Alpine) image py3-pip must be installed. The other packages are required to install matplotlib.

Create a docker and a docker-compose.yml files and place them in the same folder. Use the contents from the examples below.

Note that volumes are optional. If you want to follow this yml file on Linux or Mac then create a folder in your home folder named vm_shared and that folder will be shared with you docker image.

volumes: