graphit/graph.py
def add_edges(self, edges, node_from_edge=False, unicode_convert=True, run_edge_new=True, **kwargs):
        """
        Add multiple edges to the graph.

        This is the iterable version of the add_edge methods allowing
        multiple edge additions from any iterable.
        If the iterable yields a tuple with a dictionary as third
        argument the key/value pairs of that dictionary will be added
        as attributes to the new edge along with any keyword arguments
        passed to the method.

        The latter functionality can be used to add the edges of one
        graph to those of another by using graph.edges.items() as
        argument to `add_edges`.
        
        :param edges:           Objects to be added as edges to the graph
        :type edges:            Iterable of hashable objects
        :param node_from_edge:  make node for edge node id's not in graph
        :type node_from_edge:   :py:bool
        :param unicode_convert: convert string types to unicode
        :type unicode_convert:  :py:bool
        :param run_edge_new:    run the custom initiation method (new method) of
                                the new edges once.
        :type run_edge_new:     :py:bool
        
        :return:                list of edge ids for the objects added in
                                the same order as th input iterable.
        :rtype:                 :py:list
        """

        edges_added = []
        for edge in edges:
            if len(edge) == 3 and isinstance(edge[2], dict):
                attr = {}
                attr.update(edge[2])
                attr.update(kwargs)
                edges_added.append(self.add_edge(edge[0], edge[1], node_from_edge=node_from_edge,
                                                 unicode_convert=unicode_convert, run_edge_new=run_edge_new, **attr))
            else:
                edges_added.append(self.add_edge(edge[0], edge[1], unicode_convert=unicode_convert,
                                                 node_from_edge=node_from_edge, run_edge_new=run_edge_new, **kwargs))
        
        return edges_added

        Add multiple edges to the graph.

        This is the iterable version of the add_edge methods allowing
        multiple edge additions from any iterable.
        If the iterable yields a tuple with a dictionary as third
        argument the key/value pairs of that dictionary will be added
        as attributes to the new edge along with any keyword arguments
        passed to the method.

        The latter functionality can be used to add the edges of one
        graph to those of another by using graph.edges.items() as
        argument to `add_edges`.
        
        :param edges:           Objects to be added as edges to the graph
        :type edges:            Iterable of hashable objects
        :param node_from_edge:  make node for edge node id's not in graph
        :type node_from_edge:   :py:bool
        :param unicode_convert: convert string types to unicode
        :type unicode_convert:  :py:bool
        :param run_edge_new:    run the custom initiation method (new method) of
                                the new edges once.
        :type run_edge_new:     :py:bool
        
        :return:                list of edge ids for the objects added in
                                the same order as th input iterable.
        :rtype:                 :py:list
        
Add multiple edges to the graph.
This is the iterable version of the add_edge methods allowing
multiple edge additions from any iterable.
If the iterable yields a tuple with a dictionary as third
argument the key/value pairs of that dictionary will be added
as attributes to the new edge along with any keyword arguments
passed to the method.

The latter functionality can be used to add the edges of one
graph to those of another by using graph.edges.items() as
argument to `add_edges`.
Add multiple edges to the graph . This is the iterable version of the add_edge methods allowing multiple edge additions from any iterable . If the iterable yields a tuple with a dictionary as third argument the key / value pairs of that dictionary will be added as attributes to the new edge along with any keyword arguments passed to the method . The latter functionality can be used to add the edges of one graph to those of another by using graph . edges . items () as argument to ` add_edges ` .
def add_edges(self, edges, node_from_edge=False, unicode_convert=True, run_edge_new=True, **kwargs):
        edges_added = []
        for edge in edges:
            if len(edge) == 3 and isinstance(edge[2], dict):
                attr = {}
                attr.update(edge[2])
                attr.update(kwargs)
                edges_added.append(self.add_edge(edge[0], edge[1], node_from_edge=node_from_edge,
                                                 unicode_convert=unicode_convert, run_edge_new=run_edge_new, **attr))
            else:
                edges_added.append(self.add_edge(edge[0], edge[1], unicode_convert=unicode_convert,
                                                 node_from_edge=node_from_edge, run_edge_new=run_edge_new, **kwargs))
        return edges_added
def add_edges ( self , edges , node_from_edge = False , unicode_convert = True , run_edge_new = True , ** kwargs ) : edges_added = [ ] for edge in edges : if len ( edge ) == 3 and isinstance ( edge [ 2 ] , dict ) : attr = { } attr . update ( edge [ 2 ] ) attr . update ( kwargs ) edges_added . append ( self . add_edge ( edge [ 0 ] , edge [ 1 ] , node_from_edge = node_from_edge , unicode_convert = unicode_convert , run_edge_new = run_edge_new , ** attr ) ) else : edges_added . append ( self . add_edge ( edge [ 0 ] , edge [ 1 ] , unicode_convert = unicode_convert , node_from_edge = node_from_edge , run_edge_new = run_edge_new , ** kwargs ) ) return edges_added
Add multiple edges to the graph.
Add multiple edges to the graph .
"""
        Add multiple edges to the graph.

        This is the iterable version of the add_edge methods allowing
        multiple edge additions from any iterable.
        If the iterable yields a tuple with a dictionary as third
        argument the key/value pairs of that dictionary will be added
        as attributes to the new edge along with any keyword arguments
        passed to the method.

        The latter functionality can be used to add the edges of one
        graph to those of another by using graph.edges.items() as
        argument to `add_edges`.
        
        :param edges:           Objects to be added as edges to the graph
        :type edges:            Iterable of hashable objects
        :param node_from_edge:  make node for edge node id's not in graph
        :type node_from_edge:   :py:bool
        :param unicode_convert: convert string types to unicode
        :type unicode_convert:  :py:bool
        :param run_edge_new:    run the custom initiation method (new method) of
                                the new edges once.
        :type run_edge_new:     :py:bool
        
        :return:                list of edge ids for the objects added in
                                the same order as th input iterable.
        :rtype:                 :py:list
        """
list of edge ids for the objects added in
the same order as th input iterable.
list of edge ids for the objects added in the same order as th input iterable .
:py:list
self
edges
Objects to be added as edges to the graph
Objects to be added as edges to the graph
node_from_edge
make node for edge node id's not in graph
make node for edge node id ' s not in graph
unicode_convert
convert string types to unicode
convert string types to unicode
run_edge_new
run the custom initiation method (new method) of
the new edges once.
run the custom initiation method ( new method ) of the new edges once .