A code to compute the abundances of chemical species in the interstellar medium