Skip to content

Instantly share code, notes, and snippets.

@sbaer
Created June 16, 2011 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbaer/1028638 to your computer and use it in GitHub Desktop.
Save sbaer/1028638 to your computer and use it in GitHub Desktop.
shapeways including pricing
"""Sample script that accesses the shapeways API
http://www.shapeways.com/api
"""
import wsdlprovider
wsdl_url = "http://api.shapeways.com/v1/wsdl.php"
username = "username"
password = "password"
application_id = "rhinotest"
assembly = wsdlprovider.GetWebservice(wsdl_url)
shapeways = assembly.SWwsdlService()
session_id = shapeways.login(username, password, application_id)
if session_id:
#get list of printers available
printers = shapeways.getPrinters(session_id, "", application_id)
if printers:
for printer in printers:
print "printer:", printer.title
for material in printer.materials:
print " - material ", material.title
material_id = material.id
price = shapeways.getModelPrice(session_id, 10, material_id, "", "")
print " price for 10 cc =", price.price, " ", price.currency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment