Altova RaptorXML+XBRL Server 2024

RaptorXML+XBRL Server as a Python Package

Home Prev Top Next

Starting with RaptorXML+XBRL 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+XBRL Server without the need to build these modules specifically for RaptorXML+XBRL Server. Otherwise, the wheel package works the same way as the RaptorXMLXBRL-python.exe application that is included with RaptorXML+XBRL 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+XBRL Server, make sure to update the Python wheel package in your Python environment.

 

The information required to correctly install the RaptorXML+XBRL Server package is given in the sections below:

 

Name of wheel file

Location of wheel file

Installing a wheel with pip

Troubleshooting the installation

The root catalog file

The JSON config file

 

For information about how to use RaptorXML+XBRL 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.9.0-cp35-cp35m-win_amd64.whl

 

Location of wheel file

A wheel file is packaged with your installation of RaptorXML+XBRL Server. It is located in the application's bin folder:

 

Windows

Program Files\Altova\RaptorXMLXBRLServer2024\bin

Linux

/opt/Altova/RaptorXMLXBRLServer2024/bin

Mac

/usr/local/Altova/RaptorXMLXBRLServer2024/bin

 

Installing a wheel with pip

To install the RaptorXML+XBRL 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+XBRL Server and can be used as described below.

 

Windows

If the vcruntime140_1.dll is missing, copy it from the Program Files\Altova\RaptorXMLXBRLServer2024\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+XBRL Server Python package and distributed with RaptorXML+XBRL Server. This can be fixed by using $LD_LIBRARY_PATH to point to the newer library in the RaptorXML+XBRL Server folder, like this: $ export LD_LIBRARY_PATH=/opt/Altova/RaptorXMLXBRLServer2024/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+XBRL Server Python package and distributed with RaptorXML+XBRL Server. This can be fixed by using $DYLD_LIBRARY_PATH to point to the newer library in the RaptorXML+XBRL Server folder, like this: $ export DYLD_LIBRARY_PATH=/usr/local/Altova/RaptorXMLXBRLServer2024/lib.

 

 

The root catalog file

The RaptorXMLXBRL module for Python must be able to locate RootCatalog.xml, the root catalog file that is stored in your RaptorXML+XBRL Server installation folder. This is so that the RaptorXMLXBRL 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 RaptorXMLXBRL module will automatically locate RootCatalog.xml if the catalog's location has not been changed subsequent to the installation of RaptorXML+XBRL Server.

 

In case you move or modify your RaptorXML+XBRL 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 RaptorXMLXBRL module's JSON Config File. See the list below for the various ways in which you can do this. The RaptorXMLXBRL 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\RaptorXML+XBRLServer\Installation_v2024_x64\Setup\CatalogPath

Registry key is added by RaptorXML+XBRL Server installer. Value is the path to RootCatalog.xml. Windows only

3

Location: /opt/Altova/RaptorXMLXBRLServer2024/etc/RootCatalog.xml

Linux only

4

Location: /usr/local/Altova/RaptorXMLXBRLServer2024/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 RaptorXMLXBRLServer 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"

}

 

© 2018-2024 Altova GmbH