  The $k\cdot p$ method is significant in condensed matter physics for the
compact and analytical Hamiltonian. In the presence of magnetic field, it is
described by the effective Zeeman's coupling Hamiltonian with Land\'e $ g
$-factors. Here, we develop an open-source package VASP2KP (including two
parts: vasp2mat and mat2kp) to compute $k\cdot p$ parameters and Land\'e
$g$-factors directly from the wavefunctions provided by the density functional
theory (DFT) as implemented in Vienna ab initio Simulation Package (VASP).
First, we develop a VASP patch vasp2mat to compute matrix representations of
the generalized momentum operator $
\mathbf{\hat{\pi}}=\mathbf{\hat{p}}+\frac{1}{2mc^2}\left(\mathbf{\hat{s}}\times\nabla
V(\mathbf{r})\right) $, spin operator $\mathbf{\hat{s}}$, time reversal
operator $\hat{T}$ and crystalline symmetry operators $\hat{R}$ on the DFT
wavefunctions. Second, we develop a python code mat2kp to obtain the unitary
transformation $U$ that rotates the degenerate DFT basis towards the standard
basis, and then automatically compute the $k\cdot p$ parameters and
$g$-factors. The theory and the methodology behind VASP2KP are described in
detail. The matrix elements of the operators are derived comprehensively and
computed correctly within the projector augmented wave method. We apply this
package to some materials, e.g., Bi$_2$Se$_3$, Na$_3$Bi, Te, InAs and 1H-TMD
monolayers. The obtained effective model's dispersions are in good agreement
with the DFT data around the specific wave vector, and the $g$-factors are
consistent with experimental data. The VASP2KP package is available at
https://github.com/zjwang11/VASP2KP.
