This work presents an algorithm for calculating high temperature series expansions (HTSE) of Heisenberg spin models with spin S=1/2S=1/2 in the thermodynamic limit. This algorithm accounts for the presence of a magnetic field. The paper begins with a comprehensive introduction to HTSE and then focuses on identifying the bottlenecks that limit the computation of higher order coefficients. HTSE calculations involve two key steps: graph enumeration on the lattice and trace calculations for each graph. The introduction of a non-zero magnetic field adds complexity to the expansion because previously irrelevant graphs must now be considered: bridged graphs. We present an efficient method to deduce the contribution of these graphs from the contribution of sub-graphs, that drastically reduces the time of calculation for the last order coefficient (in practice increasing by one the order of the series at almost no cost). Previous articles of the authors have utilized HTSE calculations based on this algorithm, but without providing detailed explanations. The complete algorithm is publicly available, as well as the series on many lattice and for various interactions.