Python for MapLarge SDK
  1. server = "<a href="http://server.maplarge.com/"
  2. user">http://server.maplarge.com/"
  3. user</a> = "<a href="mailto:user@ml.com">user@ml.com</a>"
  4. pw = "pw123456"
  5.  
  6. #CREATE MAPLARGE CONNECTION WITH USER / PASSWORD
  7. mlconnPassword = MapLargeConnector(server, user, pw)
  8.  
  9. #CREATE MAPLARGE CONNECTION WITH USER / AUTH TOKEN
  10. mlconnToken = MapLargeConnector(server, user, token)
  11.  
  12. #CREATE TABLE SYNCHRONOUS (NO WEB CALL)
  13. params = {"account": "aidsvualpha", "tablename": "testPythonSdkTable", "fileurl": "<a href="http://localhost/testfile.csv"">http://localhost/testfile.csv"</a>}
  14. mlconnToken.NO_WEB_CALLS = True
  15. response = mlconnToken.InvokeAPIRequest("CreateTableSynchronous", params)
  16. print response
  17.  
  18. mlconnPassword.NO_WEB_CALLS = False
  19.  
  20. #RETRIEVE REMOTE USER AUTH TOKEN
  21. response = mlconnPassword.GetRemoteAuthToken(user, pw, "255.255.255.255")
  22. print response
  23.  
  24. #List Groups
  25. params = {"account": "aidsvualpha"}
  26. response = mlconnPassword.InvokeAPIRequestPost("ListGroups", params)
  27. print response
  28.  
  29. #CREATE TABLE WITH FILES SYNCHRONOUS
  30. params = {"account": "aidsvualpha", "tablename": "testTable"}
  31. fileList = ["c:\\temp\\usa.csv"]
  32. print mlconnPassword.InvokeAPIRequestPost("CreateTableWithFilesSynchronous", params, fileList)