API Reference

Execution Commands

Command

Python

Description

$abort

exit()

interrupts the report (current and upper levels)

$ask

input(prompt)

prompts a question

$beep

will not be implemented

produces a beep sound

$chdir

os.chdir(path) [1]

changes the current directory

$debug

to be implemented

indicates the file and line currently being executed

$define

my_variable = value

defines a macro

$foreach

for item in iterable

loops over a list of values

$goto

not supported by Python

(un)conditional branch to a label

$incrtime

increment_t()

increments the current period t (default is 1)
used when evaluating a LEC expression

$indent

No equivalent (Python
IS indentation-sensitive)

enables or disables indentation

$label

not supported by Python

marks a branch point

$maximize

maximizes the IODE window (OLD interface)

$minimize

minimizes the IODE window (OLD interface)

$mkdir

os.mkdir(path) [1]

creates a new directory

$multiline

use backslash \

enables or disables multiple lines

$msg

print(message)

displays a message and waits for a key press

$next

no need

ends a loop

$noparsing

enables or disables parsing of text
between backquotes

$procdef

def function_name(…)

defines a procedure (user defined function)

$procend

No need

ends the definition of a procedure

$procexec

function_name(arguments)

executes a procedure

$onerror

to be implemented

action to take in case of error

$prompt

input(prompt)

defines a macro by prompting the user

$quit

exit()

exits IODE

$repeat

for item in iterable

loops over the arguments

$repeatstring

defines the characters to be replaced in $repeat

$return

return value

exits the current report

$rmdir

os.rmdir(path) [1]

deletes an empty directory

$settime

set_t()

sets the variable t

$shift

no equivalent in Python

shifts the report arguments one position to the left

$show

print(variable)

displays a message at the bottom of the screen

$sleep

time.sleep(seconds) [2]

pauses the process for a short period

$system

os.system(command) [1]

executes a system command

$vseps

text.split(separators)

redefines the separators used by @vdrop(),
@vtake() and @vcount()

IODE Functions

Strings

Function

Python

Description

@upper(text)

txt.upper()

converts text to uppercase

@lower(text)

txt.lower()

converts text to lowercase

@replace(string, from, to)

txt.replace(old, new)

substitutes one text for another

@fmt(val, fmt)

formats a number

@take(n, string)

txt[:n]

extracts the first n characters of string.
If n is negative, extracts the last n characters.

@drop(n, string)

txt[n:]

removes the first n characters of string.
If n is negative, removes the last n characters.

@count(string)

len(txt.split(‘,’))

returns the number of elements in string
(separated by commas)

@index(n, list)

split_list(list_txt)[n-1]

returns the nth element of list

@sqz(string)

txt.replace(’ ‘, ‘’)

removes spaces from string

@strip(string)

txt.strip()

removes trailing spaces from string

@ansi(text)

see String Methods

converts an Ascii text to Ansi

@equal(t1, t2)

t1 == t2

compares t1 and t2.
Returns 1 if equal, 0 otherwise

@void(t1, …)

will not be implemented

returns no text, whatever the arguments

List Of Strings

Function

Python

Description

@vtake(n, list)

list_txt.split(separators)[:n]

take the first n elements of the list
(or last n elements if n is negative)

@vdrop(n, list)

list_txt.split(separators)[n:]

drop the first n elements of the list
(or last n elements if n is negative)

@vcount(list)

len(list_txt.split(separators))

return the number of elements in the list

Files

Function

Python

Description

@fdelete(filename)

Path(filepath).unlink()

deletes the file filename

@fappend(filename, string)

open(filepath, ‘a’)

writes the text to a file

Directories

Function

Python

Description

@getdir()

os.getcwd()

returns the current directory

@chdir(dirname)

os.chdir(dirname) [1]

changes the current directory to dirname and
returns the new current directory

@mkdir(dirname)

os.mkdir(dirname) [1]

creates a new directory dirname

@rmdir(dirname)

os.rmdir(dirname) [1]

deletes the directory dirname

Dates And Times

Function

Python

Description

@date([format])

returns the date

@time([format])

returns the time

@month(month, language)

returns the text of the month
in the given language

@ChronoReset()

start = time.time_ns() [3]

resets the timer to 0

@ChronoGet()

delta_t = time.time_ns() - start [3]

returns the elapsed time (in
msecs) since the last timer reset

Lists Of Objects

Function

Python

Description

@cexpand(pattern, …)

Comments.get_names()

returns the list of comments matching pattern

@eexpand(pattern, …)

Equations.get_names()

returns the list of equations matching pattern

@iexpand(pattern, …)

Identities.get_names()

returns the list of identities matching pattern

@lexpand(pattern, …)

Lists.get_names()

returns the list of lists matching pattern

@sexpand(pattern, …)

Scalars.get_names()

returns the list of scalars matching pattern

@texpand(pattern, …)

Tables.get_names()

returns the list of tables matching pattern

@vexpand(pattern, …)

Variables.get_names()

returns the list of variables matching pattern

@vliste(objname, …)

returns the list of variables in the
equation(s), identity(ies), table(s)

@sliste(objname, …)

returns the list of scalars in the
equation(s), identity(ies), table(s)

Objects Content

Function

Python

Description

@ttitle(tablename,tablename, …)

Table.title

returns the titles of the tables

@srelax(sclname,sclname, …)

Scalar.relax

returns the relax value for scalars

@sstderr(sclname,sclname, …)

Scalar.std

returns the stderr value for scalars

@cvalue(cmtname,cmtname, …)

comments[names]

returns the content of a comments

@vvalue(varname,varname, …)

variables[names]

returns the values of variables as text

@sample(B|E|)

Variables.sample

returns the (beginning/ending of) the
current sample as text

Equations

Function

Python

Description

@evalue(eqname, eqname, …)

Equation.lec

returns the LEC text of an equation

@eqsample(eqname)

Equation.sample

returns the estimation sample
of the equation

@eqsamplefrom(eqname)

returns the FROM part of
the estimation sample

@eqsampleto(eqname)

returns the TO part of
the estimation sample

@eqlhs(eqname)

Equation.split_equation()

returns the left-hand side
of an equation

@eqrhs(eqname)

Equation.split_equation()

returns the right-hand side
of an equation

Simulations

Function

Python

Description

@SimEps()

Simulation.convergence_threshold

returns the value of the convergence
criterion used for the last simulation

@SimRelax()

Simulation.relax

returns the value of the relaxation
parameter used for the last simulation

@SimMaxit()

Simulation.max_nb_iterations

returns the value of the maximum
number of iterations used for the
last simulation

@SimNiter(period)

Simulation.nb_iterations()

number of iterations required to solve
the model for year period

@SimNorm(period)

Simulation.norm()

convergence threshold reached when
solving the model for year period

IODE Commands

Report - Command Execution

Command

Python

Description

reportexec

execute_report()

executes an IODE report
(recursive, allows multiple levels of sub-reports)

execute_command()

executes an IODE command or function in Python

Files

Function

Python

Description

fileprint

prints a file to the defined printer

filedelete

deletes a file on disk with specific extensions

filerename

renames a file on disk with specific extensions

filecopy

copies a file on disk with specific extensions

SysCopyFile

copies any file on disk with any extension

SysMoveFile

renames any file on disk with any extension

SysDeleteFile

deletes any file on disk with any extension

SysOemToAnsi

converts file encoding from OEM to ANSI

SysOemToUTF8

converts file encoding from OEM to UTF8

SysAnsiToOem

converts file encoding from ANSI to OEM

SysAnsiToUTF8

converts file encoding from ANSI to UTF8

SysAppendFile

appends one file to another

FileImportVar

Variables.convert_file()

imports variables in various formats
(DIF, ASCII, etc.)

FileImportCmt

Comments.convert_file()

imports comments in various formats
(DIF, ASCII, etc.)

Workspace Operations

Function

Python

Description

WsLoad

load()

loads a workspace cmt, …, var from a file

WsCopy

copy_into()

copies a workspace cmt, …, var from a file

WsMerge

merge_from()

merges one or several IODE data files
into a workspace cmt, …, var

WsClear

clear()

deletes a workspace cmt, …, var

WsClearAll

clears all workspaces

WsDescr

description

describes a workspace cmt, …, var

WsSave

save()

saves a workspace cmt, …, var to a file

WsSaveCmp

save()

saves a workspace cmt, …, var to a file
in compressed form

WsSample

Variables.sample

changes the sample of the Variables
workspace

WsExtrapolate

Variables.extrapolate()

extends series by extrapolation

WsLtohStock

Variables.low_to_high()

builds higher frequency series for stocks

WsLtohFlow

Variables.low_to_high()

builds higher frequency series for flows

WsHtolSum

Variables.high_to_low()

builds lower frequency series (sum)

WsHtolMean

Variables.high_to_low()

builds lower frequency series (mean)

WsHtolLast

Variables.high_to_low()

builds lower frequency series
(last observation)

WsSeasonAdj

Variables.seasonal_adjustment()

builds seasonally adjusted series

WsSeasAdj

Variables.seasonal_adjustment()

selects the seasonal adjustment criterion

WsTrend

Variables.trend_correction()

computes trend series (Hodrick-Prescott)
using log transformation

WsTrendStd

Variables.trend_correction()

computes trend series (Hodrick-Prescott)
using the standard method

WsImport

load()

imports an ASCII file

WsExport

save()

exports to a file in ASCII format

WsImportEviews

will not be implemented

imports E-Views equations and scalars

CsvSave

saves a workspace in csv format

CsvDigits

sets the number of decimals in CSV files

CsvSep

sets the cell separator in CSV files

CsvDec

sets the decimal separator in CSV files

CsvNaN

sets the text indicating an undefined value
in CSV files

CsvAxes

sets the name of the variable axis
in CSV files

Data Operations

Command

Python

Description

datacreate

creates an object (cmt, …, var)

datadelete

del workspace[name]

deletes an object (cmt, …, var)

dataexist

name in workspace

tests for the existence of an object (cmt, … var)

dataedit

workspace[name] = value for

edits an object (cmt, …, var)

dataupdate

workspace[name] = value for

modifies an object (cmt, …, var)

dataappend

workspace[name] = workspace[name] + value for

appends an object (cmt / lst)

dataduplicate

workspace[new_name] = workspace[name] for
duplicates an object (cmt, …, var)
(an equation cannot be duplicated)

datarename

rename()

renames an object (cmt, …, var)

datasearch

search()

searches for an object (cmt, …, var)

datascan

(Equation, Identity and Table)

scans the objects (eqs / idt / tbl)

datalistXxx

get_names()

creates a list of objects given a pattern

datalistsort

sorted with Python lists

sorts a list in alphabetical order

datacompareEps

Variables.threshold

sets the equality threshold for variable
comparison

datacompareXxx

compare()

compares the workspace and a file and
creates lists (OLD, NEW, SAME and CHANGED)

datacalclst

performs logical operations on lists

datacalcvar

variables[name] = "LEC expression"

calculates a variable based on a LEC expression

datadisplaygraph

displays a graph based on series

datasavegraph

saves a graph calculated from series

datawidthvar

via GUI

sets the column width for editing series

datandecvar

via GUI

sets the number of decimals for editing series

datamodevar

Variables.mode

sets the mode for editing series

datastartvar

via GUI

sets the first period for editing series

datawidthtbl

via GUI

sets the column width for editing tables

datawidthscl

via GUI

sets the column width for editing scalars

datandecscl

via GUI

sets the number of decimals for editing scalars

dataeditcnf

via GUI

changes the editing options for variables

datarasvar

Variables.execute_RAS()

RAS method for completing a matrix of series

datapatternXXX

get_names()

creates lists of names from a pattern

Equations

Command

Python

Description

EqsEstimate

estimates an equation or a block of equations

EqsStepWise

estimates a block of equations and searches
for the best possible tests for all possible
combinations of coefficients

EqsSetCmt

Equation.comment

sets comment to an equation

EqsSetSample

Equation.sample

sets sample to an equation

EqsSetMethod

Equation.method

sets estimation method for an equation

EqsSetInstrs

Equation.instruments

sets instruments for an equation

EqsSetBloc

Equation.block

sets bloc membership for an equation

Printer Configuration

Command

Python

Description

printdest

sets the print destination

printdestnew

sets the print destination and resets the print file

printnbdec

sets the number of decimals for printing

printlang

sets the default language for printing

PrintA2mAppend

prevents the a2m file from being cleared before printing

PrintFont

sets the font for printing

PrintTableFont

sets the font for tables

PrintTableBox

sets the border width for tables

PrintTableColor

enables or disables color in tables

PrintTableWidth

sets the width of tables in Frame and Rtf

PrintTableBreak

enables or disables table breaks across multiple pages

PrintTablePage

forces a page break before each table

PrintBackground

sets the background color (tables and charts)

PrintGraphBox

sets the border width for charts

PrintGraphBrush

sets the background density for charts

PrintGraphSize

sets the size of charts

PrintGraphPage

forces a page break before each chart

PrintRtfHelp

generates an RTF file for Windows help

PrintRtfTopic

creates a new topic (Windows Help)

PrintRtfLevel

changes the hierarchical level of the following topics

PrintRtfTitle

sets the title for Windows help

PrintRtfCopyright

sets the copyright text for Windows help

PrintHtmlHelp

generates an HTML file for HtmlHelp

PrintHtmlStrip

when generating an HTML file (A2mToHtml), does not
generate a header or footer

PrintParanum

enables numbering of headings

PrintPageHeader

sets the page header for printed pages

PrintPageFooter

sets the page footer for printed pages

SetPrinter

sets the default printer

PrintOrientation

sets the paper orientation in the printer

PrintDuplex

sets the duplex (double-sided) mode of the printer

PrintGIFBackColor

sets the background color for charts

PrintGIFTransColor

sets the color considered as “transparent”

PrintGIFTransparent

indicates if the GIF file should be transparent

PrintGIFInterlaced

indicates if the GIF file should be interlaced

PrintGIFFilled

indicates whether to fill bars in bar charts

PrintGIFFont

specifies the font number to use

Object Printing

Command

Python

Description

printobjdef

Comments.print_to_file()

prints a definition of an object cmt, …, var

printobjtitle

Tables.print_tables_as

specifies whether only the titles
should be printed

printobjlec

Equations.print_equations_lec_as

specifies the type of equation to print

printobjinfos

Equations.print_equations_as

specifies the information to print

Table Compilation And Printing

Command

Python

Description

PrintTblFile

Tables.print_to_file()

defines files to use when printing
comparison tables

PrintTbl

builds and prints tables in A2M format

ViewTblFile

load_extra_files()

defines files to use when viewing
comparison tables

ViewTbl

Table.compute()

builds and displays tables

ViewByTbl = ViewTbl

Table.compute()

alias for ViewTbl

PrintVar

builds and prints comparison tables
of series in A2M format

ViewVar

views comparison tables of series in
A2M format

ViewNdec

Table.compute()

specifies the number of decimals for
values displayed in tables

ViewWidth (obsolete)

via GUI

specifies column width when displaying
tables

ViewWidth0 (obsolete)

via GUI

specifies the width of the first column
when displaying tables

Graphs From IODE Tables

Command

Python

Description

ViewGr

ComputedTable.plot()

displays tables as graphs

PrintGr

ComputedTable.print_to_file()

prints one or more graphs defined from tables

DataPrintGraph

ComputedTable.plot()

prints graphs built directly from variables

Models (Simulations)

Command

Python

Description

ModelCalcSCC

Simulation.model_calculate_SCC()

decomposes the model into SCC
and reorders it

ModelSimulateParms

Simulation

prepares new simulation

ModelSimulate

Simulation.model_simulate()

launches the simulation
of a model

ModelSimulateSCC

Simulation.model_simulate_SCC()

launches simulation of a model
decomposed into SCC and sorted

ModelExchange

Simulation.model_exchange()

defines or cancels
endogenous-exogenous exchanges
for simulation

ModelCompile

Simulation.model_compile()

recompiles equations
(useful if equations use macros)

ModelSimulateSaveNiters

Simulation.save_nb_iterations()

saves the number of iterations
required for each period
during simulation

ModelSimulateSaveNorms

Simulation.save_norms()

saves the convergence threshold
reached for each period
during simulation

Identities Execution

Command

Python

Description

idtexecute

Identities.execute()

executes identities and calculates series

idtexecutetrace

Identities.execute()

saves identity calculation trace in A2M file

idtexecutevarfiles

Identities.execute()

specifies files to search for variables
during identity calculation

idtexecutesclfiles

Identities.execute()

specifies files to search for scalars
during identity calculation

A2M File Translation

Command

Python

Description

A2mToHtml

translates A2M file to HTML format

A2mToRtf

translates A2M file to RTF format

A2mToMif

translates A2M file to MIF format (FrameMaker)

A2mToCsv

translates A2M file to CSV format

A2mToPrinter

interprets and prints an A2M file

Other Report Commands

Command

Python

Description

StatUnitRoot

dickey_fuller_test()

Dickey-Fuller tests

WsAggrChar

To be implemented

sets the character to introduce in the code of series
created by WsAggr[…]

WsAggrSum

To be implemented

computes the sum of series

WsAggrMean

To be implemented

computes the mean of series

WsAggrProd

To be implemented

computes the product of series