In this paper, we present a novel thermodynamically based analysis method for directed networks, and in particular for time-evolving networks in the finance domain. Based on an analogy with a dilute gas in statistical mechanics, we develop a partition function for a network composed of directed motifs. The method relies on the decomposition of directed networks into a series of frequently occurring graphlets, or motifs. According to the connection between a directed network and the dilute gas, the network motifs have the same topological structure as the low-order interactions between particles in the gas. This means that we can use the so-called cluster expansion from statistical mechanics to develop a partition function for the motif deco...