We consider a one-dimensional system of particles with strong zero-range interactions. This system can be mapped onto a spin chain of the Heisenberg type with exchange coefficients that depend on the external trap. In this paper, we present an algorithm that can be used to compute these exchange coefficients. We introduce an open source code CONAN (Coefficients of One-dimensional N-Atom Networks) which is based on this algorithm. CONAN works with arbitrary external potentials and we have tested its reliability for system sizes up to around 35 particles. As illustrative examples, we consider a harmonic trap and a box trap with a superimposed asymmetric tilted potential. For these examples, the computation time typically scales with the number of particles as O(N3.5±0.4). Computation times are around 10 s for N=10 particles and less than 10 min for N=20 particles.