Hooks to Create New DocType and Create Custom Entries

Apologies if this has been answered before, tried searching but couldnt find anything.

  1. What is the best way to create a hook that creates a custom DocType? is there something like export fixtures for custom doctypes?

  2. What is the best way to create a hook that creates custom entries in say the Customer DocType?

Its called an “app”

ok…

I know it sounds funny but like how do you get the app to create the DocType and the table upon installation? Is there something like export fixtures?

Also is there a way to import records into Doctypes upon installation?

Umm… try fixtures. Let us know if anything breaks.

https://frappe.github.io/frappe/user/tutorial/app

https://frappe.github.io/frappe/user/guides/app-development/how-to-create-custom-fields-during-app-installation.html