Please enable JavaScript to view this site.

Altova RaptorXML+XBRL Server 2020

Engine APIs: Python and .NET > Python API

RaptorXML+XBRL Server as a Python Package

Scroll Home Prev Top Next More

Starting with RaptorXML+XBRL Server 2017, the Python API is available as a native Python wheel package for Python 3.7. The Python wheel package can be installed as an extension module into your favored Python 3.7 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.7 extension module and is compatible with Python version 3.7.

 

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

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

 

Examples:

raptorxmlserver-2.6.0-cp35-cp35m-win_amd64.whl

raptorxmlserver-2.6.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\RaptorXMLXBRLServer2020\bin

Linux

/opt/Altova/RaptorXMLXBRLServer2020/bin

Mac

/usr/local/Altova/RaptorXMLXBRLServer2020/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.7 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/.

 

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_v2020_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/RaptorXMLXBRLServer2020/etc/RootCatalog.xml

Linux only

4

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

}

 

© 2019 Altova GmbH