Graph Nodes

Python SDK reference for the codes.nodes resource

Warning

The SDKs are in research preview. Their interfaces may change between minor versions until 1.0.

Access this resource from client.codes.nodes. Both async and sync clients expose the same methods.

list

GET /v1/codes/{code_id}/nodes

result = await client.codes.nodes.list(
    code_id=code_id,
)

Arguments:

code_idstrpathrequired
paramsNodeListParams | Nonequery
default:None
namestring
node_typestring
file_idstring
entrypoint_onlyboolean
no_depsboolean

Returns: ResultsResponse[GraphSnapshotNode]

show properties (1)hide properties (1)
resultsarray of GraphSnapshotNode
show properties (26)hide properties (26)
idstringrequired
languageLanguagerequired
file_idstringrequired
file_pathstringrequired
short_idstringrequired
node_typestringrequired
sub_typeOptional[string]
src_start_posintegerrequired
src_end_posintegerrequired
docstringOptional[string]
namestringrequired
merkle_hashstringrequired
dm_hashOptional[string]
visibilityOptional[NodeVisibility]
mutabilityOptional[string]
is_virtualboolean
is_implementedboolean
signatureOptional[string]
is_callablebooleanrequired
is_declarationbooleanrequired
is_containerbooleanrequired
is_entrypointbooleanrequired
fieldsarray of GraphFieldMetadataItem
show properties (6)hide properties (6)
namestringrequired
typeOptional[string]
valueOptional[string]
mutabilityOptional[string]
discriminantOptional[integer]
constraintsarray of GraphConstraintItem
show properties (2)hide properties (2)
namestringrequired
valueOptional[array of string]
parametersarray of GraphParameterStorageMetadata
show properties (10)hide properties (10)
param_indexOptional[integer]required
start_byteintegerrequired
is_readboolean
is_writtenboolean
fieldOptional[string]
field_start_byteOptional[integer]
param_nameOptional[string]
type_nameOptional[string]
bound_to_ref_posOptional[integer]
bound_to_return_indexOptional[integer]
returnsarray of GraphReturnStorageMetadata
show properties (7)hide properties (7)
param_indintegerrequired
param_nameOptional[string]
type_nameOptional[string]
bound_to_fieldOptional[string]
bound_to_param_indexOptional[integer]
bound_to_ref_posOptional[integer]
bound_to_return_indexOptional[integer]
low_level_kindsarray of GraphLowLevelKind
show properties (2)hide properties (2)
kindLowLevelKindrequired
depthintegerrequired

calls between the node and the nearest occurrence; 0 when the node does it itself

get

GET /v1/codes/{code_id}/nodes/{node_id}

result = await client.codes.nodes.get(
    code_id=code_id,
    node_id=node_id,
)

Arguments:

code_idstrpathrequired
node_idstrpathrequired

Returns: GraphSnapshotNode

show properties (26)hide properties (26)
idstringrequired
languageLanguagerequired
file_idstringrequired
file_pathstringrequired
short_idstringrequired
node_typestringrequired
sub_typeOptional[string]
src_start_posintegerrequired
src_end_posintegerrequired
docstringOptional[string]
namestringrequired
merkle_hashstringrequired
dm_hashOptional[string]
visibilityOptional[NodeVisibility]
mutabilityOptional[string]
is_virtualboolean
is_implementedboolean
signatureOptional[string]
is_callablebooleanrequired
is_declarationbooleanrequired
is_containerbooleanrequired
is_entrypointbooleanrequired
fieldsarray of GraphFieldMetadataItem
show properties (6)hide properties (6)
namestringrequired
typeOptional[string]
valueOptional[string]
mutabilityOptional[string]
discriminantOptional[integer]
constraintsarray of GraphConstraintItem
show properties (2)hide properties (2)
namestringrequired
valueOptional[array of string]
parametersarray of GraphParameterStorageMetadata
show properties (10)hide properties (10)
param_indexOptional[integer]required
start_byteintegerrequired
is_readboolean
is_writtenboolean
fieldOptional[string]
field_start_byteOptional[integer]
param_nameOptional[string]
type_nameOptional[string]
bound_to_ref_posOptional[integer]
bound_to_return_indexOptional[integer]
returnsarray of GraphReturnStorageMetadata
show properties (7)hide properties (7)
param_indintegerrequired
param_nameOptional[string]
type_nameOptional[string]
bound_to_fieldOptional[string]
bound_to_param_indexOptional[integer]
bound_to_ref_posOptional[integer]
bound_to_return_indexOptional[integer]
low_level_kindsarray of GraphLowLevelKind
show properties (2)hide properties (2)
kindLowLevelKindrequired
depthintegerrequired

calls between the node and the nearest occurrence; 0 when the node does it itself

content

GET /v1/codes/{code_id}/nodes/{node_id}/content

A node's source text.

result = await client.codes.nodes.content(
    code_id=code_id,
    node_id=node_id,
)

Arguments:

code_idstrpathrequired
node_idstrpathrequired
paramsNodeContentParam | Nonequery
default:None
with_docstringboolean
resolve_docstringboolean

Returns: str

edges

GET /v1/codes/{code_id}/nodes/{node_id}/edges

result = await client.codes.nodes.edges(
    code_id=code_id,
    node_id=node_id,
)

Arguments:

code_idstrpathrequired
node_idstrpathrequired
paramsEdgeListParams | Nonequery
default:None
directionEdgeDirection
edge_typeEdgeType

Returns: ResultsResponse[GraphSnapshotEdge]

show properties (1)hide properties (1)
resultsarray of GraphSnapshotEdge
show properties (16)hide properties (16)
idstringrequired
src_idstringrequired
dst_idOptional[string]
short_src_idstringrequired
short_dst_idOptional[string]
edge_typeEdgeTyperequired
src_start_posintegerrequired
call_bindingsarray of GraphCallBinding
show properties (7)hide properties (7)
param_indexintegerrequired
param_namestringrequired
type_nameOptional[string]
bound_to_fieldOptional[string]
bound_to_param_indexOptional[integer]
bound_to_ref_posOptional[integer]
bound_to_return_indexOptional[integer]
src_field_namesarray of string
dst_field_namesarray of string
directionOptional[EdgeDirection]
target_effect_idOptional[string]
low_level_nameOptional[string]
low_level_kindOptional[LowLevelKind]
src_node_typestringrequired
dst_node_typeOptional[string]

call_chain

POST /v1/codes/{code_id}/call-chain

The call chains through the given nodes.

result = await client.codes.nodes.call_chain(
    code_id=code_id,
    body=body,
)

Arguments:

code_idstrpathrequired
bodyCallChainBodybodyrequired
node_idsarray of string
response_type'json' | 'text'

Returns: ResultsResponse[GraphCallChain]

show properties (1)hide properties (1)
resultsarray of GraphCallChain
show properties (5)hide properties (5)
node_idstringrequired
short_idstringrequired
is_resolvedbooleanrequired
response_type'json' | 'text'required
call_nodesarray of GraphCallNode | stringrequired
show properties (15)hide properties (15)
node_idOptional[string]required
short_idOptional[string]required
nameOptional[string]required
node_typeOptional[string]required
edge_idOptional[string]required
edge_typeOptional[EdgeType]required
low_level_nameOptional[string]required
low_level_kindOptional[LowLevelKind]required
target_effect_idOptional[string]required
is_argbooleanrequired
is_cyclicbooleanrequired
src_field_namesarray of stringrequired
dst_field_namesarray of stringrequired
resolved_bindingsarray of GraphResolvedStorageAccessrequired
show properties (6)hide properties (6)
edge_type'reads' | 'writes' | 'uses'required
start_byteintegerrequired
bound_to_node_idstringrequired
bound_to_short_idstringrequired
bound_to_nameOptional[string]required
fieldOptional[string]
childrenarray of integerrequired

Positions of this node's children in the chain, in call order.

On this page