Is this matter still relevant to you, @gharbeia? Here is my brief report on a related topic:
Some years ago, I completed a project in a similar field. In my case, it was a self-written Python library for converting between ODF and the yWriter writing program.
I have created a pure Python application with a tkinter GUI.
Furthermore, a LibreOffice extension that makes the range of functions accessible directly from LibreOffice Writer and Calc.
I used my own packaging system, which scans the Python code and integrates all imported modules “inline” into a single Python file. That was the easiest way for me to handle the library and application.
To automate versioning and the update process, I also generated the OXT using a build script. However, the OpenOffice Extension Compiler by Bernard Marcelly was a great help in understanding the whole process in the first place.
Basically, using a Python macro in an extension is no big deal. However, you should consider how your LibreOffice installation calls the Python interpreter and which version number it has. Under Windows, LibreOffice comes with its own Python installation, which is reasonably up to date provided that the user updates LibreOffice regularly (which I don’t do, for example, since version 7.6 runs satisfactorily for me).
I don’t know how it works on Mac OS. On Linux I believe LibreOffice calls up the system’s Python interpreter. This can lead to surprises, because some LTS distributions (in my case: openSuse leap) have outdated Python versions installed.
A particular challenge for me was a variant for OpenOffice. My Python library requires Python 3, while OpenOffice on Windows still comes with Python 2. In this case, I wrote a StarBasic macro that calls the Python 3 interpreter installed by the user on Windows with the Python 3 application coming with the extension, passing the correct parameters. A bit nerdy, but it worked perfectly for me in everyday use (I use AOO 3.4 for novel writing because of a commercial spell checker extension that is not available for LibreOffice).
I am writing all this to draw your attention to a few pitfalls. The PyPDF library requires Python 3.9+, which is important to keep in mind. It is also subject to a private license, which is probably not a serious obstacle, but can still complicate matters.
If I understand you correctly, you want to package the PyPDF library into a LibreOffice extension. I can imagine that this would work, but I still have to ask what the advantage of doing so would be. For third-party macros, it is not necessarily easier to access a Python library installed in this way than if it were installed normally, i.e., with PyPi. Above all, I see the problem here with updates and version incompatibilities.
My advice: first create an application macro that accesses a regularly installed PyPDF library, and then try step by step to move this library elsewhere.
Good luck,
Peter