Values#
The values the driver reads and the wrappers it sends. All are importable from agensgraph.
Graph values#
See Graph values.
- class agensgraph.Vertex#
A vertex. Read-only, compared and hashed on its identity.
- property label: str#
The label it was created with.
- property properties: dict[str, Any]#
Its property map, a
dict, decoded on first access.
- get(key: str, default: Any = None) Any#
One property, or
default.
- properties_json() bytes#
The property map as JSON
bytes, without decoding it if nothing has.
- class agensgraph.Edge#
An edge: everything a
Vertexhas, plus its endpoints.
- class agensgraph.Path(vertices: tuple[Vertex, ...], edges: tuple[Edge, ...])#
A path: a sequence of vertex, edge, vertex, and so on.
len()is the number of elements.- property length: int#
The number of hops: of edges.
- class agensgraph.GraphId(labid: int, locid: int)#
An element’s identity: the label’s id and the element’s number within the label. Prints as
labid.locid, orders as the server does, and is sent as agraphid.- labid#
The label’s id, up to
LABID_MAX.
- locid#
The element’s number in the label, up to
LOCID_MAX.
- property packed: int#
The 64-bit integer the server stores.
- agensgraph.LABID_MAX = 65535#
The largest label id.
- agensgraph.LOCID_MAX = 281474976710655#
The largest element number within a label.
Values you send#
See Parameters.
- class agensgraph.Unspecified(value: str)#
A string sent with no type, for the server to infer from where it is used: psycopg’s default behaviour, for plain SQL. Not for Cypher, where an untyped string is parsed as JSON.
- class agensgraph.Jsonb(obj: Any)#
psycopg’s wrapper, re-exported: send any JSON value as
jsonb, such as a list forUNWIND %s.
- class agensgraph.Label(name: str)#
A
strsubclass for a label or property name. It is not quoted for you: put a name into a statement withagensgraph.cypher.quote_identifier().
Numbers#
See Numbers.
- agensgraph.read_numbers_exactly(enabled: bool = True)#
Read every non-integer in a property map or a
jsonbcolumn as aDecimal, for the whole process. Set it once, at startup.
- agensgraph.reading_numbers_exactly() bool#
Whether non-integers are read as
Decimal.
JSON#
See Handing values to something that wants JSON.
- agensgraph.to_json(obj: Any) bytes#
JSON
bytesfor a value, a row or a result, copying property maps nobody read as the bytes they arrived in.
- agensgraph.to_builtins(obj: Any) Any#
One graph value as
dicts andlists.
- agensgraph.json_default(obj: Any) Any#
A
default=hook forjson.dumps.