I just got this working, still hardcoded values right now, but it works to generate child bps based on any blueprint class. If you’re basing off a C++ class its a bit easier.
The root class string is achieved from right-clicking the asset and copying reference.
import unreal as ue
# New Asset Name
asset_name = "AwesomeNewAsset"
# Save Path
package_path = "/Game/Lush"
# Derive a Class from a string path
root_class = '/Game/Lush/Blueprints/Placables/Prop_Base.Prop_Base'
root_class_generated = root_class + "_C"
root_class_loaded = ue.EditorAssetLibrary.load_asset(root_class)
# Derive a BlueprintGeneratedClass from a UBlueprint
# If you have a C++ class, you can replace all this with just ue.CPPCLASSNAMEHERE
parent_class = ue.get_default_object(ue.load_object(None, root_class_generated)).get_class()
# Factory Setup
factory = ue.BlueprintFactory()
factory.set_editor_property("ParentClass", parent_class)
# Get Asset Tools
asset_tools = ue.AssetToolsHelpers.get_asset_tools()
# Create Asset
childBP = asset_tools.create_asset(asset_name, package_path, root_class_loaded.static_class(), factory)