pythonsaxonsaxon-c

Making saxon-c available in Python


I have just read that Saxon is now available for Python, and that's just great fun and good, but can anyone write a tutorial on how to make it available for Python/Anaconda/WingIDE or similar? I am used to installing with pip or conda, and pointing to a package/wheel for integration in my environment, but I have never started from scratch, as it feels I am doing here, or am I missing something?

The doc states that:

The Python extension on the Linux and MacOS platforms can be built using the following command:python3 saxon-setup.py build_ext -if

Well, I'm on a windows machine so what then? I've tried to read up on this subject, but recepies and ".h" files seems to be way over my head.

I just really want to get this to work on Python, but for now, I'm stuck with xslt and xpath 1.0 in Python, and having to wrestle through Java for xslt 2+.

Any help would be apreciated!

I will write another question here on StackOverflow, but with focus on how to build using Cython when I have a 64-bit version of Anaconda installed. This seems to be my initial problem.


Solution

  • I have managed to build saxonc for Python on a couple of Windows 10 machines where I had already installed Visual Studio 2017 or 2019 with Python 3 support and C/C++ support.

    The steps are roughly, for the current version of SaxonC HE:

    For Saxon-C HE 1.2.1 they are: