Skip to main content
Solved

Python libraries run before workbench

  • September 21, 2017
  • 3 replies
  • 5 views

oliver.morris
Contributor
Forum|alt.badge.img+12

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([{'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=[400404])

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) 

Best answer by david_r

Have a look here:

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

View original
Did this help you find an answer to your question?

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

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


david_r
Celebrity
  • Best Answer
  • September 21, 2017

oliver.morris
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • September 21, 2017

excellent, thank you so much


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings