Vertec Python Stub Files for use in code editors
Operating mode
Cloud Suite
|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 they run.
To make the Vertec Python modules available for the Type Checker, we provide Stub Files of the built-in Vertec Modulesvtcapp
, vtcextensions
, ziputils
, vtcplanning
, vtcplanningcore
, reporting
, vtccom
, vtcindexing
, vtcbi
and vtcauth
with.
For On-Premises customers, these are stored in the PythonStubs subfolder in the Vertec installation directory.
Cloud Suite customers can download the Stub Files here and save them locally:
You can then import them in the Code Editor.
How to do this is explained here using the Visual Studio Code example.
Pylance
and click on Install
. YouYes and reload
.Python
Extension.Python
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 in 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 need to 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).
So that the context-Variable works, the following type annotation must be used in Python (example):
def calc_table(context): # type: (Context) -> Table