In Scikit learn library, you have parameter called ccp_alpha as parameter for DescissionTreeClassifier. Using this you can do post-compexity-pruning for DecessionTrees. Check this out https://scikit-learn.org/stable/auto_examples/tree/plot_cost_complexity_pruning.html