RaptorXML Server as a Python Package
Starting with RaptorXML Server 2024, the Python API is available as a native Python wheel package for Python 3.11.8. The Python wheel package can be installed as an extension module in your favored Python 3.11.8 distribution (for example, from python.org). Some Python 3 distributions (for example, from jupyter.org, anaconda.org and SciPy.org) include a wide range of extension modules for big data, mathematics, science, engineering and graphics. These modules now become available to RaptorXML Server without the need to build these modules specifically for RaptorXML Server. Otherwise, the wheel package works the same way as the RaptorXMLXBRL-python.exe application that is included with RaptorXML Server.
Note: | The Python wheel package is a native Python 3.11.8 extension module and is compatible with Python version 3.11.8. |
Note: | The Python wheel package does not include the Python API v1. |
Note: | If you update your version of RaptorXML Server, make sure to update the Python wheel package in your Python environment. |
The information required to correctly install the RaptorXML Server package is given in the sections below:
•Troubleshooting the installation
For information about how to use RaptorXML Server's Python API, see the Python API Reference and examples. Also see example scripts that use Raptor's Python API at https://github.com/altova.
Name of wheel file
Wheel files are named according to the following pattern:
raptorxmlserver-{version}(-{build tag})?-{python tag}-{abi tag}-{platform tag}.whl
Example:
raptorxmlserver-2.10.0-cp35-cp35m-win_amd64.whl
Location of wheel file
A wheel file is packaged with your installation of RaptorXML Server. It is located in the application's bin folder:
Windows | Program Files\Altova\RaptorXMLServer2025\bin |
Linux | /opt/Altova/RaptorXMLServer2025/bin |
Mac | /usr/local/Altova/RaptorXMLServer2025/bin |
Installing a wheel with pip
To install the RaptorXML Server package as a Python module, use the pip command:
pip install <wheel-file>.whl
python -m pip install <wheel-file>.whl
If you have installed Python 3.11.8 or later from python.org, then pip will already be installed. Otherwise, you will need to install pip first. For more information, see https://docs.python.org/3/installing/.
Troubleshooting the installation
In case you are using older versions of the Python interpreter, you might have to adjust your installation to use the latest vcruntime libraries on windows or standard C++ libraries on Unix. These libraries are distributed with RaptorXML Server and can be used as described below.
Windows
If the vcruntime140_1.dll is missing, copy it from the Program Files\Altova\RaptorXMLServer2025\bin folder to the Python installation folder (the folder containing python.exe). (More generally, the Python interpreter needs to know where to find DLLs or shared libraries.)
Linux
If your system's C++ library is outdated, then your Python interpreter will not know how to find the newer C++ library that is used by the RaptorXML Server Python package and distributed with RaptorXML Server. This can be fixed by using $LD_LIBRARY_PATH to point to the newer library in the RaptorXML Server folder, like this: $ export LD_LIBRARY_PATH=/opt/Altova/RaptorXMLServer2025/lib.
macOS
If your system's C++ library is outdated, then your Python interpreter will not know how to find the newer C++ library that is used by the RaptorXML Server Python package and distributed with RaptorXML Server. This can be fixed by using $DYLD_LIBRARY_PATH to point to the newer library in the RaptorXML Server folder, like this: $ export DYLD_LIBRARY_PATH=/usr/local/Altova/RaptorXMLServer2025/lib.
The root catalog file
The RaptorXML module for Python must be able to locate RootCatalog.xml, the root catalog file that is stored in your RaptorXML Server installation folder. This is so that the RaptorXML module can use the catalog to correctly locate the various resources, such as schemas and other specifications, that the module references in order to carry out functions such as validations and transformations. The RaptorXML module will automatically locate RootCatalog.xml if the catalog's location has not been changed subsequent to the installation of RaptorXML Server.
In case you move or modify your RaptorXML Server environment, or if you move RootCatalog.xml from its original installed location, then you can specify the catalog's location by means of environment variables and the RaptorXML module's JSON Config File. See the list below for the various ways in which you can do this. The RaptorXML module determines the location of RootCatalog.xml by looking up the following resources in the order given.
1 | Environment variable ALTOVA_RAPTORXML_PYTHON_CATALOGPATH | Create with a value that is the path to RootCatalog.xml |
2 | HKLM Registry: SOFTWARE\Altova\RaptorXMLServer\Installation_v2025_x64\Setup\CatalogPath | Registry key is added by RaptorXML Server installer. Value is the path to RootCatalog.xml. Windows only |
3 | Location: /opt/Altova/RaptorXMLServer2025/etc/RootCatalog.xml | Linux only |
4 | Location: /usr/local/Altova/RaptorXMLServer2025/etc/RootCatalog.xml | Mac only |
5 | Environment variable ALTOVA_RAPTORXML_PYTHON_CONFIG | Create with a value that is the path to the JSON config file. |
6 | Location: .altova/raptorxml-python.config | The JSON config file in the current working directory |
7 | Location: ~/.config/altova/raptorxml-python.config | The JSON config file in the user's home directory |
8 | Location: /etc/altova/altova/raptorxml-python.config | The JSON config file. Linux and Mac only |
The JSON config file
You can create a JSON config file for the RaptorXMLServer module. This file will be used by options 5 to 8 in the table above to locate the root catalog file. The JSON config file must contain a map with a "CatalogPath" key that has a value which is the path to the root catalog file.
Listing of JSON config file
{
"CatalogPath": "/path/to/RootCatalog.xml"
}