How to programmatically create views in Drupal 7 How do I programmatically create views in Drupal 7?

I would like to create a custom module that would output data as a view.

Is there any documentation on how to output views from a custom module?
My first guess was to create a desired view using UI, export it and paste the generated code into own module.
And I guess this is how admin_menu installs their admin views. You could install the module just for testing and see the contents of /admin_menu/admin_views/views_default/. At any rate, you would have to resort to writing a custom module and adhere to views' hooks syntax.