If you are already using the networkx library, then you can implement a tree using that. Otherwise, you can try one of the other answers.
NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.
As 'tree' is another term for a (normally rooted) connected acyclic graph, and these are called 'arborescences' in NetworkX.
You may want to implement a plane tree (aka ordered tree) where each sibling has a unique rank and this is normally done via labelling the nodes.
However, graph language looks different from tree language, and the means of 'rooting' an arborescence is normally done by using a directed graph so, while there are some really cool functions and corresponding visualisations available, it would probably not be an ideal choice if you are not already using networkx.
An example of building a tree:
import networkx as nx
G = nx.Graph()
G.add_edge('A', 'B')
G.add_edge('B', 'C')
G.add_edge('B', 'D')
G.add_edge('A', 'E')
G.add_edge('E', 'F')
The library enables each node to be any hashable object, and there is no constraint on the number of children each node has.
The library also provides graph algorithms related to trees and visualization capabilities.