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, from version 6.4.0.15 onwards we supply stub files of the built-in Vertec Modules
vtcapp
, vtcextensions
and ziputils
, from Vertec 6.6 onwards the stub files vtcplanning
, vtcplanningcore
and reporting
and from Vertec 6.7.0.7 the Stub File vtccom
with.
For on-premises customers, these are stored in the subfolder PythonStubs in the Vertec installation directory.
Cloud subscription customers can download the stub files here and save them locally:
You can then import them in the Code Editor.
How this is done is explained here using the example Visual Studio Code.
Pylance
and click on Install
. YouYes and reload
.Python
Extension.Python
enter and select Extensions
> Pylance
. Enter the path to your Vertec Stub Files, e.g.:Python
and check that as a Language Server Pylance
is registered:
The required module must be imported into the scripts, 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