graphistry.validate package#

Submodules#

graphistry.validate.validate_encodings module#

graphistry.validate.validate_encodings.cascade_encoding(base_encoding, encoding)#
graphistry.validate.validate_encodings.validate_complex(encodings, kind, attributes=None)#
Parameters:

attributes (List | None)

graphistry.validate.validate_encodings.validate_complex_encoding(kind, mode, name, enc, attributes=None)#
Parameters:

attributes (List | None)

graphistry.validate.validate_encodings.validate_complex_encoding_badge(kind, mode, name, badge)#
graphistry.validate.validate_encodings.validate_complex_encoding_color(base_path, kind, mode, name, enc)#
graphistry.validate.validate_encodings.validate_complex_encoding_icon(kind, mode, name, enc)#
graphistry.validate.validate_encodings.validate_edge_encodings(encodings, edge_attributes=None)#
Parameters:

edge_attributes (List | None)

graphistry.validate.validate_encodings.validate_encodings(node_encodings, edge_encodings, node_attributes=None, edge_attributes=None)#

Validate node and edge encodings for compatibility with the given attributes.

This function processes and validates the node_encodings and edge_encodings against the provided node and edge attributes, ensuring they follow the expected format. If any encoding is invalid, a ValueError is raised with details. It is a subset of what the server checks, and run by the uploader.

Parameters:
  • node_encodings (dict) – Encodings for the nodes in the graph.

  • edge_encodings (dict) – Encodings for the edges in the graph.

  • node_attributes (Optional[List]) – List of node attributes to validate encodings against.

  • edge_attributes (Optional[List]) – List of edge attributes to validate encodings against.

Returns:

A dictionary containing the validated encodings for nodes and edges, in the form:

Return type:

dict

Example:

node_encodings = {‘color’: ‘blue’, ‘size’: 5} edge_encodings = {‘weight’: 0.2} result = validate_encodings(node_encodings, edge_encodings) # {‘node_encodings’: {‘color’: ‘blue’, ‘size’: 5}, ‘edge_encodings’: {‘weight’: 0.2}}

graphistry.validate.validate_encodings.validate_encodings_generic(encodings, kind, required_bindings)#
graphistry.validate.validate_encodings.validate_mapping(mapping, base_path)#
graphistry.validate.validate_encodings.validate_node_encodings(encodings, node_attributes=None)#
Parameters:

node_attributes (List | None)

graphistry.validate.validate_encodings.validate_style(base_path, enc)#

Module contents#