Python TRX Library Reference (iTDS)

Modified on: Wed, 27 Sep, 2023 at 9:22 PM

Warning: Python TRX Local Library Reference (iTDS) is no longer supported. We recommend using the Python Maltego-TRX.

Input Entity Object

This object is used to read the Maltego request. It is passed along to each Transform and is assigned to the variable "m". The attributes below provide details about the input Entity.

Member NameDescription
m.Value (String)The value of the node as displayed on the graph. Note that this is not necessarily the value you want work with (see URL entity).
m.Weight (Integer)The weight of the node.
m.Slider (Integer)The slider's value – e.g. how many results should be returned.
m.Type (String)The type of the input node. See Entity definitions for possible values.
m.Properties (List)A list of properties of the node. Name, value pairs as strings
m.TransformSettings(List)The settings for the Transform. A list of name, value pairs as strings.


Available Methods

The following methods are defined to read Entity properties and Transform settings. You can read it straight out of the Property and Transform Settings list, but it's nicer to use these functions as they do some error checking:

Member NameDescriptionReturns
(String property name)
Returns the value of the key, None if not definedValue
(String transform setting name)
Returns the value of the key, None if not definedValue

Transform Object

This is used to construct the reply to the iTDS. All values are strings.

TRX = MaltegoTransform()

Available Methods

Method NameDescriptionReturns
([String Type,
String Value])
Adds an entity to the return vessel with type 'Type' and value 'Value'. Note that these can be set using functions in MaltegoEntity library.MaltegoEntity
(String msg,
Const type)
Shows a message 'msg' in the Maltego GUI. Types could be
  • UIM_FATAL (pop up window)
  • UIM_PARTIAL (yellow)
  • UIM_INFORM (default)
  • UIM_DEBUG (light gray)
(String msg)
Throws a Transform exceptionNone
TRX.returnOutput()Returns the XML of the vesselNone

Entity Object

This is the object that defines a single Entity within Maltego. An Entity can be created using the 'addEntity' method in the MaltegoTransform class.

me = TRX.addEntity(type, value)
Method NameDescription
(String Type)
Sets the type of the entity – see list of Entity definitions for possible values
(String Value)
Sets the value of the entity
(Integer weight)
Sets the weight of the entity
(String Value,
[String Label])
Adds display information for label named 'Label'. This field is rendered as HTML within Maltego. Default label is 'Info'.
(String propertyname,
String displayname,
String matchingrule,
String value)
Adds a property to the entity. Each property has a name, value and a display name. The display name is how it will be represented within Maltego. The matching rule determines how entities will be matched and could be 'strict' (default) or 'loose'
(String URL)
If set it will change the appearance of the icon. The URL should point to a PNG or JPG file. Maltego will size to fit but lots of large files will drain resources.
(String HexColor)
Sets the color of the link to the node. Colors are in hex –for example '0xff00ff'
(Const Style)
Sets the style of the link to the node. The following constants should be used:
(Integer thickness)
Sets the thickness of the link to the node. Value is in pixels.
(String value)
Sets the label of the link to the node.
(Const Color)
Sets the bookmark color of the node. Keep in mind that these are chosen from a set number of colors. Use the following constants:
(String note)
Creates an annotation to the node with value 'note'. If a subsequent Transform sets an annotation on the node it will appended to the note.


Reversing Entity Links 

To reverse an Entity link - add a property to the returning Entit(y/ies) as follows: = <direction>

Possible values for direction are:

  • input-to-output            (default)
  • output-to-input
  • bidirectional



Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.