Since then (2016), a few small changes in the API have been made, mainly occurring between the 2.7x and 2.8 versions.
Something messed up with the formatting of panel code, but it doesn’t say which space type or region, and there is also the bl_category attribute if the panel is going into a side-bar, that is the name of the tab for it.
panels have to have:
bl_label
bl_space_type
bl_region_type
bl_category is optional
in some cases, bl_context is also needed, such as in the window region of the properties space
Even though it can be found in the manual, here is how to interrogate blender what the options are for space and region:
>>> bpy.types.Region.bl_rna.properties["type"].enum_items[:]
[<bpy_struct, EnumPropertyItem("WINDOW")>, <bpy_struct, EnumPropertyItem("HEADER")>, <bpy_struct, EnumPropertyItem("CHANNELS")>, <bpy_struct, EnumPropertyItem("TEMPORARY")>, <bpy_struct, EnumPropertyItem("UI")>, <bpy_struct, EnumPropertyItem("TOOLS")>, <bpy_struct, EnumPropertyItem("TOOL_PROPS")>, <bpy_struct, EnumPropertyItem("PREVIEW")>, <bpy_struct, EnumPropertyItem("HUD")>, <bpy_struct, EnumPropertyItem("NAVIGATION_BAR")>, <bpy_struct, EnumPropertyItem("EXECUTE")>, <bpy_struct, EnumPropertyItem("FOOTER")>, <bpy_struct, EnumPropertyItem("TOOL_HEADER")>]
>>> bpy.types.Space.bl_rna.properties["type"].enum_items[:]
[<bpy_struct, EnumPropertyItem("EMPTY")>, <bpy_struct, EnumPropertyItem("VIEW_3D")>, <bpy_struct, EnumPropertyItem("IMAGE_EDITOR")>, <bpy_struct, EnumPropertyItem("NODE_EDITOR")>, <bpy_struct, EnumPropertyItem("SEQUENCE_EDITOR")>, <bpy_struct, EnumPropertyItem("CLIP_EDITOR")>, <bpy_struct, EnumPropertyItem("DOPESHEET_EDITOR")>, <bpy_struct, EnumPropertyItem("GRAPH_EDITOR")>, <bpy_struct, EnumPropertyItem("NLA_EDITOR")>, <bpy_struct, EnumPropertyItem("TEXT_EDITOR")>, <bpy_struct, EnumPropertyItem("CONSOLE")>, <bpy_struct, EnumPropertyItem("INFO")>, <bpy_struct, EnumPropertyItem("TOPBAR")>, <bpy_struct, EnumPropertyItem("STATUSBAR")>, <bpy_struct, EnumPropertyItem("OUTLINER")>, <bpy_struct, EnumPropertyItem("PROPERTIES")>, <bpy_struct, EnumPropertyItem("FILE_BROWSER")>, <bpy_struct, EnumPropertyItem("PREFERENCES")>]
>>>
If you want something in the n-key sidebar of the 3d viewport, that would be “UI” for the region type, “VIEW_3D” for the space type, and then use bl_category to set the name of the tab.