Skip to main content
Question

Python in fme packages for other custom transformers?

  • 17 July 2024
  • 2 replies
  • 30 views

I have a number of CustomTransformers which contain some python - this python may or may not include some third parts python dependencies. It’s not only python, they also use regular old FME transformers as well.

I’ve been playing around with the package development guide and doing some testing. I can see how to import third party modules for just normal CustomTransformers. 

I’d really like to be able to use the package manager tools here to help with dependencies, however, it seems like from my experimenting that fme based custom transformers can not benefit from these tools.

Does any one know anything or have any comments on this?

2 replies

Userlevel 6
Badge +39

Sorry if this isn’t the question you’re asking, but for python libraries, you could include a ‘setup.py’ pythoncaller that checks the python install for the libraries, and installs any that are missing

https://stackoverflow.com/questions/4527554/check-if-module-exists-if-not-install-it

Userlevel 5
Badge +32

  

Sorry if this isn’t the question you’re asking, but for python libraries, you could include a ‘setup.py’ pythoncaller that checks the python install for the libraries, and installs any that are missing

https://stackoverflow.com/questions/4527554/check-if-module-exists-if-not-install-it

Yeah thanks, I’ve actually thought about this as a back up, but it just adds a little more complexity I guess. Ideally it would all be nicely bundled up in the package. 

But I have figured out what I need to do. I just need to pip install my packages into the “src” directory in the FME package project. 

I have figured out that the downside of working with CustomTransformers in  packages (FME ones rather than pure python based) is that they need to be linked all the time. This of course makes sense because you always want it to get the latest changes etc but can be a bit annoying if you want to share a workspace with it in it. The user is required to install the package first, and if you don’t have it on the FME hub then it’s a manual process to install the package.  

 

Reply