Z2Pack automates the calculation of topological numbers of band-structures. It works with first-principles calculations (z2pack.fp), tight-binding models (z2pack.tb) and explicit Hamiltonian matrices (z2pack.hm).
The topological numbers are computed from the evolution of Wannier charge centers (WCC), as described in this paper for the case of the Z2 invariant. The code, methods and various examples are described in this paper.
The WCC are calculated from overlap matrices which are calculated either directly (for tb and hm) or via the Wannier90 code package (fp).