  We introduce PyCrystalField, a Python software package for calculating
single-ion crystal electric field (CEF) Hamiltonians. This software can
calculate a CEF Hamiltonian \textit{ab initio} from a point charge model for
any transition or rare earth ion in either the $J$ basis or the $LS$ basis,
perform symmetry analysis to identify nonzero CEF parameters, calculate the
energy spectrum and observables such as neutron spectrum and magnetization, and
fit CEF Hamiltonians to any experimental data. The theory, implementation, and
examples of its use are discussed.
