An overview of the Vertec Python stub files used 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 already before execution.
To make the Vertec Python modules available for the type checker, we provide stub files with built-in Vertec modules vtcapp
, vtcextensions
, ziputils
, vtcplanning
, vtcplanningcore
, reporting
, vtccom
, vtcindexing
, vtcbi
and vtcauth
.
For On-Premises customers, these are stored in the PythonStubs subfolder in the Vertec installation directory.
Cloud Suite customers can download the stub files below and save them locally:
You can then import them into the code editor.
Below, we explain how to do this using Visual Studio Code as an example:
Pylance
and click on Install
. You may see a question about the default language. Answer it with Yes and reload
.Python
extension.Python
and select Extensions
> Pylance
. Enter the path to your Vertec stub files, e.g.:Python
subdirectory and check that Pylance
is entered as the language server:
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 Python code for Office reports.
You must import this 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).
In order for the context variable to work, the following type annotation must be used in Python (example):
def calc_table(context): # type: (Context) -> Table