Hello,
a new version of APSO (1.4.0alpha) has just been created. This corresponds to the branch APSO with_pip in the APSO gitlab repository. It is currently in the Alpha phase, which means that it is an experimental phase to see if the features introduced are operational and do not disrupt the rest of the extension. This version contains as a new feature a pip package manager which allows you to add external modules contained in the python pypi package repository . The extension ( apso.oxt in the with_pip branch directory) has been tested with recent versions of LibreOffice and OpenOffice under Windows 11, Ubuntu 20.04 and Macos Catalina 10.15. To download the extension click on apso.oxt and in the new window click on the download icon). Note that in the with_pip branch directory there is the README.md file which explains the new functionality ( Package manager at the end of the document). This is what it looks like:
In the example directory , there is an example workbook which allows you to test the numpy module in a python macro. In this workbook we generate random integers using the python array generator function numpy.random.randint . Carefully read the README.md file in this example directory before using the workbook. There are issues with LibreOffice under Macos and Linux. And for OpenOffice you need to install a particular version of numpy .
You are invited to test this new version of APSO. If there are any comments or problems, you can report in this thread.
There is another example using the pyPDF2 package to extract infos from a filled form PDF here. Sorry it is in french language (google translation is your friend).
friendly, JP
APSO : new version with pip package manager
- Jurassic Pork
- Posts: 26
- Joined: Wed Oct 25, 2017 7:55 am
- Location: France
APSO : new version with pip package manager
OpenOffice 4.1.14 , LibreOffice 7.6.2.1 on Windows 11/ LibreOffice 7.3.7 on Lubuntu 22.04
Re: APSO : new version with pip package manager
For LO simplified:There is another example using the pyPDF2 package to extract infos from a filled form PDF here.
Code: Select all
from PyPDF2 import PdfReader
def extract_from_pdf(*_):
doc = XSCRIPTCONTEXT.getDocument()
named = doc.NamedRanges
vertical = named["Vertical"].ReferredCells.String
pdf_path = named["pdfFile"].ReferredCells.String
destination = named["Dest"].ReferredCells.String
reader = PdfReader( pdf_path )
data = tuple(reader.get_form_text_fields().items())
if vertical != 'oui':
data = tuple( zip(*data))
sheet = doc.Sheets.Collecte
cursor = sheet.createCursorByRange( sheet[destination] )
cursor.collapseToSize(len(data[0]), len(data))
cursor.DataArray = data
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)