Pythonでmkdir -pのようなディレクトリ作成を行うには、os.makedirs()とpathlibの2つの方法があります。
os.makedirs()の使用
os.makedirs()は、親ディレクトリが存在しない場合でも再帰的にディレクトリを作成します。
import os
os.makedirs("/path/to/directory", exist_ok=True)
pathlib.Path.mkdir()の使用
Python 3.5以降では、pathlibを使用する方法が推奨されています。
from pathlib import Path
Path("/path/to/directory").mkdir(parents=True, exist_ok=True)
まとめ
mkdir -p相当の機能は、どちらの方法でも実現可能です。pathlibはモダンなコードで使われることが多く、推奨されます。