Network.node_attribute

Network.node_attribute(key, name, value=None)[source]

Get or set an attribute of a node.

Parameters:
keyhashable

The node identifier.

namestr

The name of the attribute

valueobj, optional

The value of the attribute.

Returns:
obj or None

The value of the attribute, or None when the function is used as a “setter”.

Raises:
KeyError

If the node does not exist.