Make sine wave around a circle?
Simple script

Translate the circle primitive into a sine wave.  The primitive circle distributes the verts x, y coords in a circle.  

The z coordinate is adjusted to oscillate in a sine wave.  



import bpy
from math import sin, pi
verts = 128 #  verts per circle
radius = 1 # radius of circle
freq = 16   #  how many phases of sin wave
amp = 0.1   # amplitude of wave
# angle per vert
apv = freq * 2 * pi / (verts)

context = bpy.context
bpy.ops.mesh.primitive_circle_add(
        vertices=verts,
        radius=radius)
ob = context.object
me = ob.data
for v in me.vertices:
    v.co.z = amp * sin(v.index * apv)
me.update()