def buy_postage(shipment, speed="normal"):

    if speed == "premium":
        shipment.buy(rate=shipment.lowest_rate(carriers=['USPS'], services=['Priority']))
    elif speed == "urgent":
        shipment.buy(rate=shipment.lowest_rate(carriers=['USPS'], services=['Express']))
    else:
        shipment.buy(rate=shipment.lowest_rate(carriers=['USPS'],))

    #print "Speed: %s" % shipment.rate
    return shipment
Can choose from several different shipping rates:
dataset/ETHPy150Open limedaring/easypost-labels/post.py/buy_postage