hydra.json.model module

A JSON syntax model. See the BNF at https://www.json.org.

class hydra.json.model.Value

Bases: object

ValueArray | ValueBoolean | ValueNull | ValueNumber | ValueObject | ValueString

ARRAY = Name(value='array')
BOOLEAN = Name(value='boolean')
NULL = Name(value='null')
NUMBER = Name(value='number')
OBJECT = Name(value='object')
STRING = Name(value='string')
TYPE_ = Name(value='hydra.json.model.Value')
class hydra.json.model.ValueArray(value: T)

Bases: Node[Sequence[Value]]

A JSON array

class hydra.json.model.ValueBoolean(value: T)

Bases: Node[bool]

A boolean value

class hydra.json.model.ValueNull

Bases: object

JSON’s null value

class hydra.json.model.ValueNumber(value: T)

Bases: Node[Decimal]

A numeric value

class hydra.json.model.ValueObject(value: T)

Bases: Node[Sequence[tuple[str, Value]]]

A JSON object as an ordered list of key/value pairs. The ordering preserves the declaration order of the record from which the object was encoded, rather than alphabetizing keys. As a consequence, equality of Value objects is order-sensitive: two objects with the same pairs in a different order are equal as JSON, but not as Hydra Values.

class hydra.json.model.ValueString(value: T)

Bases: Node[str]

A string value