Trying to write stuff to import openscad objects using python, have some questions.

I’m trying to write code to let me import and manipulate openscad objects in blender so I can use python instead of openscad to work on stuff. So far I have a few questions.

I’m assuming since openscad uses mm for it’s units I need to div all values by 1000 to get things scaled correctly in blender or is there some api call to set the measurement system?

So far openscad primitives like cube and sphere have mapped pretty closely to stuff in bpy.ops.mesh.primitive, however the openscad cylinder primitive allows specifying the top/bottom radius of the cylinder in order to make one that is tapered and I’ll be damned if I can figure out how to do that in blender using python.