MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / __init__

Method __init__

easygraph/readwrite/graphml.py:467–499  ·  view source on GitHub ↗
(
        self,
        graph=None,
        encoding="utf-8",
        prettyprint=True,
        infer_numeric_types=False,
        named_key_ids=False,
        edge_id_from_attribute=None,
    )

Source from the content-addressed store, hash-verified

465
466class GraphMLWriter(GraphML):
467 def __init__(
468 self,
469 graph=None,
470 encoding="utf-8",
471 prettyprint=True,
472 infer_numeric_types=False,
473 named_key_ids=False,
474 edge_id_from_attribute=None,
475 ):
476 self.construct_types()
477 from xml.etree.ElementTree import Element
478
479 self.myElement = Element
480
481 self.infer_numeric_types = infer_numeric_types
482 self.prettyprint = prettyprint
483 self.named_key_ids = named_key_ids
484 self.edge_id_from_attribute = edge_id_from_attribute
485 self.encoding = encoding
486 self.xml = self.myElement(
487 "graphml",
488 {
489 "xmlns": self.NS_GRAPHML,
490 "xmlns:xsi": self.NS_XSI,
491 "xsi:schemaLocation": self.SCHEMALOCATION,
492 },
493 )
494 self.keys = {}
495 self.attributes = defaultdict(list)
496 self.attribute_types = defaultdict(set)
497
498 if graph is not None:
499 self.add_graph_element(graph)
500
501 def __str__(self):
502 from xml.etree.ElementTree import tostring

Callers

nothing calls this directly

Calls 2

add_graph_elementMethod · 0.95
construct_typesMethod · 0.45

Tested by

no test coverage detected