Created
June 16, 2011 03:48
-
-
Save sbaer/1028638 to your computer and use it in GitHub Desktop.
shapeways including pricing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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