The typex Command
The
typex
command is used to manage data type handler extensions. The command has the following subcommands:
typex defined
typex defined datatypename
Typex.Defined(datatypename)
A boolean check whether a specific data type is supported by a data type handler. If the format is not yet known, an attempt is made to locate and auto-load the handler module. For an equivalent command without auto-loading, see
typex exists
.
typex exists
typex exists datatypename
tx.exists()
Typex.Exists(datatypename)
A boolean check whether a specific data type is supported by a data type handler. No attempt is made to auto-load a handler module if it is not already in memory. The name can be the primary name of the data type, or any recognized alias. For an equivalent command with auto-loading, see
typex defined
.
typex get
typex get datatypename attribute
Typex.Get(datatypename,attribute)
tx.get(attribute)
tx.attribute
tx[attribute]
Query the value of an attribute of the data type handler. Note that data type handlers are static - it is neither possible to define them on the command line, nor to change any attribute. Therefore, there are no
typex create
or
typex set
commands.
The following attributes are recognized:
-
address_city
The city part of the author contact address.
-
address_country
The country part of the author contact address, following the ISO3166 standard.
-
address_state
The state part of the author contact address. Empty if not applicable.
-
address_street
The street address part of the author contact address. Includes floor, house number, etc.
-
address_zip
The
ZIP
code or other applicable postal code of the author contact address.
-
aliases
A list of recognized alias names of the data type.
-
affiliation
The institution the author works for.
-
affiliationduns
The
DUNS
registration ID of the affiliated institution. This is primarily useful for US government projects.
-
affiliationurl
The
URL
of the affiliated institution.
-
author
The author of the module, as free-format text.
-
authorurl
A
URL
with information on the author, or an empty string if unset.
-
builtin
A boolean flag indicating whether this is a built-in type.
-
category
A category string to be used if the module is stored in a repository.
-
classuuid
The base class
UUID
of this type extension
-
cmpops
A list of the comparison operation flags the handler supports. Please refer to the
prop compare
command for a list of possible flags.
-
comment
A free-form comment
-
date
The date the module source code was last changed.
-
doi
A digital object identifier for the module, if defined.
-
elementsize
In case the data type has vector elements or other components which can be addressed in a vector-like fashion, and the size of these components is constant, this attribute reports the size of an element. A zero size is reported if this attribute is not applicable.
-
elementtype
The data type of vector elements or other components which can be addressed in a vector-like fashion. For data types without sub-elements of a constant type, this is an empty string.
-
email
An email contact address of the developer of the module.
-
flags
A collection of flags reporting specific properties of the datatype. The currently supported set is:
-
none
No flags
-
indexable
The data type supports the extraction of components.
-
knimecompatible
This data type has a compatible data type in the standard datatypes of the
KNIME
software.
-
multiline
The data type produces multi-line file output in standard formatting
-
needswritelock
Internal use only.
-
nominmax
The data type has no reasonable definition, or use of, minimum and maximum values.
-
precision
The data type supports the concept of numerical precision.
-
simplenumeric
This is a simple numeric type.
-
vector
The data type is a vector type with identical elements that can be accessed by a numeric index.
-
infourl
A
URL
with information on the module, or an empty string if unset.
-
keywords
A list of keywords associated with the module.
-
license
The license class associated with this module. Setting the license to a standard type updates the associated
URL
with a standard location.
-
licenseurl
A
URL
with details about the module license.
-
literature
A free-form literature reference.
-
indexing
A descriptive string with a short summary of the field access functions supported by this data type handler module.
-
isarray
A boolean flag indicating whether this data type is an array or not.
-
name
The primary name of the data type. Since the information may be queried via an alias name, this can be different from the command argument.
-
objectfile
The full path of the object file (DLL, shared library or bundle file) of dynamically loaded modules. For built-in handlers, this is an empty string.
-
orcid
The
ORCID
code of the author (see www.orcid.org).
-
path
The repository path for displaying hierarchical repository trees. This attribute is independent of any file system paths.
-
phone
A contact phone number of the author.
-
references
Cross references of the module. This is a nested list of class
UUID
s and reference type tags.
-
regid
For officially registered data type handlers, this is the assigned registration ID. Unregistered modules report zero.
-
slot
The slot in the handler table the module was loaded into.
-
sourcefile
The name of the source file for the module, if it is available.
-
sql
The
SQL
type name of the data type. In case there is no applicable
SQL
data type, this is an empty string.
-
sqlarray
The PostgresQL-style type name of
SQL
arrays of the data type. In case there is no such
SQL
type, this is an empty string.
-
version
Version information for the module. This is a string in a 1.2.3 (or shortened) style.
-
versionuuid
The
UUID
associated with this module version.
-
xml
The
XML
type name of the data type.
typex list
typex list ?pattern?
Typex.List(?pattern=?)
Return a list of all currently loaded data types, including those handled by built-in data type handlers. If desired, the list can be filtered by a string pattern.
typex load
typex load datatypename ?objectfile?
typex load all
Typex.Load(datatypename,?objectfile?)
Typex.Load(“all”)
Explicitly load a data type handler module. If the module is already loaded, the current version is unloaded first.
If no specific object file (a shared library on Unix/Linux, a DLL on Windows, a bundle file for MacOSX) is specified, the standard name of the module file is automatically generated from the data type name, and then the file searched in the directories in the data type handler module path. The module search path can be customized in the control variable
::cactvs(typexpath).
For
Tcl
, the return value of the command is the slot in the handler module table the module has been loaded into. This corresponds to the value of the
slot
attribute which can be queried via
typex get
. For
Python
, the return value is a module reference.
The magic name
all
instructs the program to traverse the data type extension search path and to load all data type extension modules found which are not yet loaded. In that case, the return value of the command is empty.
typex ref
Typex.Ref(datatypename)
Python
-only method to get a reference of the module, which allows terser attribute retrieval commands and other operations.
typex subcommands
typex subcommands
dir(Typex)
Return a list of all subcommands of the
typex
command in the current interpreter.
typex unload
typex unload ?datatypename?...
tx.unload()
Typex.Unload(?txref/datatypename?,...)
Unload zero or more data type handler modules. It is an error to specify the name of a module which is not loaded. Built-in handler modules cannot be unloaded. Unloading a handler module when there is still property data of that type linked to chemical objects lead to memory leaks and/or confusing error messages when operating with these objects.
The return value is the number of unloaded modules.