pydot API reference
68 public APIs from pydot (pydot/pydot) — 13 classes, 12 functions, 43 methods. Signatures extracted by static analysis of the actual source.
Repository: pydot/pydot
| Kind | Count |
|---|---|
| Classes | 13 |
| Functions | 12 |
| Methods | 43 |
API list
class
src.pydot.classes.FrozenDictFrozen dictionary, values are immutable after creation.
class
src.pydot.core.ClusterClass representing a cluster in Graphviz's dot language.
class
src.pydot.core.CommonCommon information to several classes.
method
src.pydot.core.Common.attrs_string(prefix:str='') -> strFormat the current attributes list for output.
method
src.pydot.core.Common.formatted_attr_list() -> list[str]Return a list of the class's attributes as formatted strings.
method
src.pydot.core.Common.get(name:str) -> AnyGet an attribute value by name.
method
src.pydot.core.Common.get_attributes() -> AttributeDictGet attributes of the object
method
src.pydot.core.Common.get_sequence() -> int | NoneGet sequence
method
src.pydot.core.Common.get_top_graph_type(default:str='graph') -> strFind the topmost parent graph type for the current object.
method
src.pydot.core.Common.set(name:str, value:Any) -> NoneSet an attribute value by name.
method
src.pydot.core.Common.set_sequence(seq:int) -> NoneSet sequence
class
src.pydot.core.DotA container for handling a dot language file.
method
src.pydot.core.Dot.create(prog:list[str] | tuple[str] | str | None=None, format:str='ps', encoding:str | None=None) -> bytesCreates and returns a binary image for the graph.
method
src.pydot.core.Dot.set_prog(prog:str) -> NoneSets the default program.
method
src.pydot.core.Dot.set_shape_files(file_paths:str | Sequence[str]) -> NoneAdd the paths of the required image files.
method
src.pydot.core.Dot.write(path:str | bytes, prog:str | None=None, format:str='raw', encoding:str | None=None) -> boolWrites a graph to a file.
class
src.pydot.core.EdgeA graph edge.
method
src.pydot.core.Edge.get_destination() -> EdgeEndpointGet the edge's destination endpoint.
method
src.pydot.core.Edge.get_source() -> EdgeEndpointGet the edge's source endpoint.
method
src.pydot.core.Edge.to_string(indent:Any='', indent_level:int=1) -> strReturn string representation of edge in DOT language.
class
src.pydot.core.GraphClass representing a graph in Graphviz's dot language.
method
src.pydot.core.Graph.add_edge(graph_edge:Edge) -> NoneAdds an edge object to the graph.
method
src.pydot.core.Graph.add_node(graph_node:Node) -> NoneAdds a node object to the graph.
method
src.pydot.core.Graph.add_subgraph(sgraph:Subgraph) -> NoneAdds a subgraph object to the graph.
method
src.pydot.core.Graph.del_edge(src_or_list:Any, dst:Any=None, index:int | None=None) -> boolDelete an edge from the graph.
method
src.pydot.core.Graph.del_node(name:str | Node, index:int | None=None) -> boolDelete a node from the graph.
method
src.pydot.core.Graph.get_edge(src_or_list:Any, dst:Any=None) -> list[Edge]Retrieve an edge from the graph.
method
src.pydot.core.Graph.get_edge_list() -> list[Edge]Get the list of Edge instances.
method
src.pydot.core.Graph.get_name() -> str | NoneGet the graph's name.
method
src.pydot.core.Graph.get_node(name:str) -> list[Node]Retrieve a node from the graph.
method
src.pydot.core.Graph.get_node_list() -> list[Node]Get the list of Node instances.
method
src.pydot.core.Graph.get_nodes() -> list[Node]Get the list of Node instances.
method
src.pydot.core.Graph.get_simplify() -> boolGet whether to simplify or not.
method
src.pydot.core.Graph.get_strict() -> boolGet graph's 'strict' mode (True, False).
method
src.pydot.core.Graph.get_subgraph(name:str) -> list[Subgraph]Retrieve a subgraph from the graph.
method
src.pydot.core.Graph.get_subgraph_list() -> list[Subgraph]Get the list of Subgraph instances.
method
src.pydot.core.Graph.get_suppress_disconnected() -> boolGet if suppress disconnected is set.
method
src.pydot.core.Graph.get_type() -> str | NoneGet the graph's type, 'graph' or 'digraph'.
method
src.pydot.core.Graph.set_name(graph_name:str) -> NoneSet the graph's name.
method
src.pydot.core.Graph.set_node_defaults(**attrs:Any) -> NoneDefine default node attributes.
method
src.pydot.core.Graph.set_simplify(simplify:bool) -> NoneSet whether to simplify or not.
method
src.pydot.core.Graph.set_strict(val:bool) -> NoneSet graph to 'strict' mode.
method
src.pydot.core.Graph.set_suppress_disconnected(val:bool) -> NoneSuppress disconnected nodes in the output graph.
method
src.pydot.core.Graph.set_type(graph_type:str) -> NoneSet the graph's type, 'graph' or 'digraph'.
method
src.pydot.core.Graph.to_string(indent:Any='', indent_level:int=0, inline:bool=False) -> strReturn string representation of graph in DOT language.
class
src.pydot.core.NodeA graph node.
method
src.pydot.core.Node.get_name() -> strGet the node's name.
method
src.pydot.core.Node.get_port() -> str | NoneGet the node's port.
method
src.pydot.core.Node.set_name(node_name:str | None) -> NoneSet the node's name.
method
src.pydot.core.Node.to_string(indent:Any='', indent_level:int=1) -> strReturn string representation of node in DOT language.
class
src.pydot.core.SubgraphClass representing a subgraph in Graphviz's dot language.
func
src.pydot.core.any_needs_quotes(s:str) -> bool | NoneDetermine if a string needs to be quoted.
class
src.pydot.core.frozendictDeprecated alias for pydot.classes.FrozenDict.
func
src.pydot.core.graph_from_adjacency_matrix(matrix:Sequence[Sequence[Any]], node_prefix:str='', directed:bool=False) -> DotCreates a basic graph out of an adjacency matrix.
func
src.pydot.core.graph_from_dot_data(s:str) -> list[Dot] | NoneLoad graphs from DOT description in string `s`.
func
src.pydot.core.graph_from_dot_file(path:str | bytes, encoding:str | None=None) -> list[Dot] | NoneLoad graphs from DOT file at `path`.
func
src.pydot.core.graph_from_edges(edge_list:Sequence[Any], node_prefix:str='', directed:bool=False) -> DotCreates a basic graph out of an edge list.
func
src.pydot.core.graph_from_incidence_matrix(matrix:Sequence[Sequence[Any]], node_prefix:str='', directed:bool=False) -> DotCreates a basic graph out of an incidence matrix.
func
src.pydot.core.id_needs_quotes(s:str) -> boolChecks whether a string is a dot language ID.
func
src.pydot.core.make_quoted(s:str) -> strTransform a string into a quoted string, escaping specials.
func
src.pydot.core.quote_attr_if_necessary(s:str) -> strEnclose attribute value in quotes, if needed.
func
src.pydot.core.quote_id_if_necessary(s:str, unquoted_keywords:Sequence[str] | None=None) -> strEnclose identifier in quotes, if needed.
class
src.pydot.dot_parser.GraphParserPyparsing grammar for graphviz 'dot' syntax.
class
src.pydot.dot_parser.HTMLParsing for HTML-like strings.
func
src.pydot.dot_parser.parse_dot_data(s:str) -> list[pydot.core.Dot] | NoneParse DOT description in (unicode) string `s`.
func
src.pydot.dot_parser.push_ID(toks:ParseResults) -> strJoin multiple string pieces into a single ID string.
class
src.pydot.exceptions.ErrorGeneral error handling class.
class
src.pydot.exceptions.PydotExceptionBase class for exceptions in Pydot.
About this data
These signatures were extracted from the public source of pydot/pydot
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.