Question

FME Server Rest API Python Data Upload/Download

  • 24 January 2019
  • 5 replies
  • 21 views

Badge

I am still learning FME Server's REST API and was wondering if it is possible to use python to upload a file to FME Server to be processed and receive the data download file? I am going through the REST API training and working with code that is available on the developer playground,[https://playground.fmeserver.com/python-request/] but could use some guidance on how to properly upload a file to FME Server to run the workspace and retrieve the download. For my test purposes, I'm just using txt files. I would like to upload a text file, then retrieve the output text file data download zip. I'm not familiar with Javascript, so I was wanting to integrate this into my Python application.


5 replies

Userlevel 4

Yes, it's definitely possible.

There are some sample applications that showcases this on the FME Server Playground, e.g.

https://playground.fmeserver.com/javascript/server-uploads/upload-file-in-session/

Badge

Yes, it's definitely possible.

There are some sample applications that showcases this on the FME Server Playground, e.g.

https://playground.fmeserver.com/javascript/server-uploads/upload-file-in-session/

Hi @david_r, I've looked at the javascript examples in the playground and was just curious if this was possible with python. I have successfully ran a workspace with python (using the python template code from the developer playground), but I'm looking at a way to upload/download with python.

Userlevel 4

Hi @david_r, I've looked at the javascript examples in the playground and was just curious if this was possible with python. I have successfully ran a workspace with python (using the python template code from the developer playground), but I'm looking at a way to upload/download with python.

Yes, it's definitely possible with Python as well. I would recommend using the excellent requests module, it makes things a lot easier than the standard library.

@guy_lafleur has also published Python code on github that implements parts of the REST API in Python, which can be either used as-is or as inspiration for creating something on your own:

https://knowledge.safe.com/questions/81237/python-fme-server-rest-api-wrapper.html

 

Badge

Yes, it's definitely possible with Python as well. I would recommend using the excellent requests module, it makes things a lot easier than the standard library.

@guy_lafleur has also published Python code on github that implements parts of the REST API in Python, which can be either used as-is or as inspiration for creating something on your own:

https://knowledge.safe.com/questions/81237/python-fme-server-rest-api-wrapper.html

 

Thanks @david_r, I will look into that.

Badge +5

In the current version of FME Server you can use:

POST /repositories/< repository >/items/< item >/resources

Reply