Vertec Python Stub Files for use in code editors
Product line
Standard
|Expert
Operating mode
CLOUD ABO
|ON-PREMISES
Modules
Services & CRM
Budget & Phases
Purchases
Resource Planning
Business Intelligence
Many code editors, such as Visual Studio Code, have static analysis capabilities to detect errors before execution.
In order to make the Vertec Python modules available for the Type Checker, we supply stub files of the built-in Vertec modules
vtcapp
, vtcextensions
and ziputils
, from Vertec 6.6 the stub files vtcplanning
, vtcplanningcore
and reporting
and from Vertec 6.7.0.7 the Stub File vtccom
with. These are placed in the subfolder Pythonstubs in the Vertec installation directory. Alternatively you can download the Stub Files here:
You can then import them in the Code Editor.
How this is done is explained here using the example Visual Studio Code.
Ctrl+Shift+P
and click on Install Extension
> Pylance installieren
. YouYes and reload
.Ctrl+Shift+P
the Command Line Interface.Settings
and select the option Open Settings (JSON)
.Enter the path to the Vertec Stub Files in the code python.analysis.stubPath
one:
“python.languageServer”: “Pylance,” “python.pythonPath”: “C:\\Python27\\python.exe,” “python.analysis.stubPath”: “C:\\ProgramFiles\\Vertec\\PythonStubs,”
Verify that as a Language Server Pylance
is registered (the current version was installed with point 1).
For this to work in your script, import the desired module, e.g. vtcapp
:
import vtcapp
From Vertec 6.6 we deliver with reporting.py
also a Python Stub File for the Python code for Office reports
with.
This must be imported for use as usual: from reporting import *
The methods that must be declared in the Office Report Code itself (e.g. def initialize_row(context, row)
), are included in the Stub File, but only as a documentation aid (since the method is not simply used, but has to be declared itself).
In order for the context -Variable works, the following type annotation must be used in Python (example):
def calc_table(context): # type: (Context) -> Table