See this gist for the full source.
This python script generates a random unordered rooted tree, and writes it into a JSON file. The serialization is unambiguous, leveraging the algorithm defined in a previous example.
Labels are also random and not meaningful, and they are not taken into account for the ordering.
Four example trees are also included in the repository, identified by their root’s label and their number of leaves.