And if you don’t like any of those, here’s another one that I wrote:
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
bl_info = {
"name": "Quad-sphere",
"author": "Ron Tarrant",
"version": (1, 0),
"blender": (2, 58, 0),
"api": 33832,
"location": "View3D > Add > Mesh > Quad-sphere",
"description": "Adds a sphere consisting of quads with eight distributed poles.",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Add Mesh"}
import bpy
class addQuadSphere(bpy.types.Operator):
bl_idname = "mesh.primitive_quadsphere_add"
bl_label = "Quad Sphere"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
bpy.ops.mesh.primitive_cube_add()
bpy.ops.object.modifier_add(type = 'SUBSURF')
bpy.context.object.modifiers["Subsurf"].levels = 2
modifierName = bpy.context.object.modifiers[0].name
bpy.ops.object.modifier_apply(modifier = modifierName)
bpy.context.object.name = "Quad-sphere"
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.transform.tosphere(1)
bpy.ops.object.mode_set(mode = 'OBJECT')
bpy.context.object.dimensions = (2,2,2)
bpy.ops.object.transform_apply(scale=True)
return{'FINISHED'}
# Register all operators and panels
#import space_info
# Define menu
def menu_func(self, context):
self.layout.operator("mesh.primitive_quadsphere_add", text = "Quad Sphere", icon="PLUGIN")
def register():
bpy.utils.register_module(__name__)
bpy.types.INFO_MT_mesh_add.append(menu_func)
def unregister():
bpy.utils.unregister_module(__name__)
bpy.types.INFO_MT_mesh_add.remove(menu_func)
if __name__ == "__main__":
register()
My objective was to make it as succinct and elegant as possible while also giving it the best possible chance to survive some of the unusual U-turns the code base seems to take from time to time. 
Installation:
- Save the code somewhere using the name add_mesh_quadsphere.py
- go to Blender’s User Preferences > Addons,
- (at the bottom of the dialog) Install from File,
- find the file and load it (click OK or whatever),
- click the checkbox to activate it, and
- Save User Settings to make it permanent (you can also just use it without saving preferences, but you’ll have to do this all over again next time you need it).