This is a python implementation based on the paper [Bos2003], and the original Maple implementation by Bos (which is no longer available).
[Bos2003] M. K. Bos, Coding the principal character formula for affine Kac-Moody Lie algebras, Mathematics of Computation, 72 (244), pp 2001-2012, 2003.