xgt.CustomDictionary

class xgt.CustomDictionary

An object that behaves as a dictionary and allows access to the keys as dynamic properties. The keys are ordered by arrival as a list and are iterable. A data item can be accessed using the key name using dictionary syntax and also using a ‘property’ access syntax. Key names are case sensitive in both dictionary key reference syntax and ‘property’ access syntax.

Examples

Instances of this class are during the creation of table, vertex type and edge type. >>> t = xgt.Table(name = ‘mytable’, … schema = [(‘col0’, xgt.INT), (‘col1’, xgt.TEXT)]) >>> conn.create(t) >>> tbl = conn.get_table(‘mytable’) >>> print(tbl.schema) [[‘col0’, ‘int’], [‘col1’, ‘text’]] >>> # A column can be accessed in the schema as a dictionary key. >>> print(tbl.schema[‘col0’]) int >>> # The same column can be accessed in the schema as a property. >>> print(tbl.schema.col0) int

__init__()

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__() Initialize self.