Skip to main content

I am new to using FME cloud, can you please explain how I can install custom python libraries onto FME Cloud and call them before the workbench runs. I would like to drop and create an elasticsearch index before the workbench then goes and populates it.

Many Thanks,

Oliver

The current python code is:

import pyodbc, json
from elasticsearch import Elasticsearch
es = Elasticsearch(c{'host': 'search-dev-elasticsearch-z4b7vwlsqswv4uial343rdjccq.us-east-1.es.amazonaws.com', 'port': 443}],use_ssl=True,verify_certs=False)

es.indices.delete(index='productdownloadsdb_full', ignore=/400, 404])

mapping = '''
{    "mappings": {
      "downloads": {
        "properties": {
          "HYPERLINK_PDF": {
            "type": "text"
          },
          "HYPERLINK_ZIP": {
            "type": "text"
          },
          "ID": {
            "type": "integer"
          },
          "PDF_BODY": {
            "type": "text"
          },
          "PDF_FILE": {
            "type": "text"
          },
          "Title": {
            "type": "text"
          },
          "ZIP_FILE": {
            "type": "text"
          },
          "geometry": {
            "type": "geo_point"
          }
        }
      }
    }
  }
'''
es.indices.create(index='productdownloadsdb_full', ignore=400, body=mapping) 

You can import custom python modules into FME Cloud using these steps


Have a look here:

https://knowledge.safe.com/questions/4164/python-libraries-on-fme-cloud.html


excellent, thank you so much


Reply