How to know the module package?
Maybe another simpler way exists, but after a little digging in the core I found that the modules list (admin/modules) with all the information is retrieve from the _system_rebuild_module_data() function that use the 
info_parser service to retrieve all the module information.

If you want to know the module package you can use this code:

$module_machine_name = 'views';
$module = \Drupal::service('module_handler')-&gt;getModule($module_machine_name);
$module_info = \Drupal::service('info_parser')-&gt;parse($module-&gt;getPathname());
// To use dpm() you need the devel module.
dpm($module_info['package']);


Output:


  Core