  In the band theory, first-principles calculations, the tight-binding method
and the effective $k\cdot p$ model are usually employed to investigate the
electronic structure of condensed matters. The effective $k\cdot p$ model has a
compact form with a clear physical picture, and first-principles calculations
can give more accurate results. Nowadays, it has been widely recognized to
combine the $k\cdot p$ model and first-principles calculations to explore
topological materials. However, the traditional method to derive the $k\cdot p$
Hamiltonian is complicated and time-consuming by hand. In this work, we
independently develop a programmable algorithm to construct effective $k\cdot
p$ Hamiltonians. Symmetries and orbitals are used as the input information to
produce the one-/two-/three-dimension $k\cdot p$ Hamiltonian in our method, and
the open-source code can be directly downloaded online. At last, we also
demonstrate the application to MnBi$_2$Te$_4$-family magnetic topological
materials.
