PythonFactory

From fmepedia

PythonFactory is a FME Factory.


Table of contents

Syntax

 FACTORY_DEF * PythonFactory                                            \
    FACTORY_NAME PYTHONCALLER                                           \
    INPUT  FEATURE_TYPE <featuretype>                     \
    SYMBOL_NAME <symbolName>                                    \
    OUTPUT PYOUTPUT FEATURE_TYPE <featuretype>

Description

The PythonFactory is a FME Factory whose functionality is implemented in the Python language. A PythonFactory is implemented using a python object that is specified by some symbol name. The symbol name must be fully qualified, and reference a valid python object.

Symbol Name

If the implementation object, myImplementationClass resides in an external python file, such as myMod.py, it must be referenced as myMod.myImplementationClass in the factory definition. FME Workbench provides PythonCreator and PythonCaller transformers that have a built in source code editor that edits python code directly in the workspace. If the source code resides in the workspace itself, then the implementation object, myImplementationClass, may be directly referenced as myImplementationClass.

Implementation Object Types

The implementation object can be one of three types

  1. Python functions
  2. Python classes
  3. Python objects


See Python Samples.

User Comments Add a new comment