We present TB2J, a Python package for the automatic computation of magnetic interactions, including exchange and Dzyaloshinskii–Moriya, between atoms crystals from results density functional calculations. The program is based on Green’s function method with local rigid spin rotation treated as perturbation. As input, uses output either Wannier90, which interfaced many theory packages, or codes ...