Altova RaptorXML+XBRL Server 2024

Depurar scripts de Python del lado servidor

Inicio Anterior Inicio Siguiente

La mayoría de las funciones de depuración, aparte de las devoluciones de llamada específicas del servidor, se pueden usar en un intérprete Python estándar o en un entorno (virtual) Python después de haber instalado el módulo de RaptorXML+XBRL Server con el comando pip:

 

pip install –upgrade "/path/to/RaptorXML/application-folder/bin/raptorxml-version-cp37-cp37m-winversion.whl"

 

Después de instalar la rueda debería poder usar cualquier IDE de Python para depurar un script. Puede intentar extraer la función principal como una función aparte que toma un objeto de instancia. Después puede llamar a esta función (i) con las devoluciones de llamada de RaptorXML o (ii) ejecutando directamente el script con un intérprete Python.

 

 

from altova_api.v2 import xml, xsd, xbrl

 

def main(instance):

    # Here goes the application specific logic

 

# Main entry point, will be called by RaptorXML after the XML instance validation job has finished

def on_xsi_finished(job, instance):

    # instance object will be None if XML Schema validation was not successful

    if instance:

        main(instance)

 

# Main entry point, will be called by RaptorXML after the XBRL instance validation job has finished

def on_xbrl_finished(job, instance):

    # instance object will be None if XBRL 2.1 validation was not successful

    if instance:

        main(instance)

 

if __name__ == ‘__main__’:

    # parse arguments and create an instance

    instance = …

    main(instance)

 

© 2017-2023 Altova GmbH