Download presentation
Presentation is loading. Please wait.
Published byTayler Mylin Modified over 9 years ago
1
Sep. 21-22, 2006 v FME Worldwide User Conference - Vancouver FME Translation Customization with Python Tom Weir, Safe Software
2
Customizing FME Translations with Python 2 Background Who is Tom Weir? Developer @ Safe Software Lead Developer on the these projects: Python ;) KML Writer Template Writer Windows installer fmepedia.com FME GENTRANS
3
Customizing FME Translations with Python 3 A Little History FME 2004 ICE Wouldn’t it be cool if we had a Python FME Objects API?
4
Customizing FME Translations with Python 4 A Little History FME 2004 ICE Wouldn’t it be cool if we had a Python FME Objects API? FME 2005 Can fme.exe run python scripts?
5
Customizing FME Translations with Python 5 A Little History FME 2004 ICE Wouldn’t it be cool if we had a Python FME Objects API FME 2005 Can fme.exe run python scripts? FME 2006 How about running.py scripts before/after a translation?
6
Customizing FME Translations with Python 6 A Little History FME 2004 ICE Wouldn’t it be cool if we had a Python FME Objects API FME 2005 Can fme.exe run python scripts? FME 2006 How about running.py scripts before/after a translation? FME 2006 GB We’ve got @Tcl. How about @Python?
7
Customizing FME Translations with Python 7 The Future: FME 2007 PythonFactory PythonCaller (Enhanced) PythonCreator Workbench Script Editor
8
Customizing FME Translations with Python 8 Preliminaries You must provide your own Python 2.3, 2.4, or 2.5 Python.org or ActiveState.com distro FME will choose a python to load Python 2.4 is currently preferred Preference will change to 2.5 shortly Override with the “FME_PYTHON_VERSION” directive
9
Customizing FME Translations with Python 9 pyfme Python FME Objects Wrapper Full access to the FME Objects API No Rich Geometry or Raster support (yet) Docs here: http://www.safe.com/support/fmeobjects/docs/pyfme/ http://www.safe.com/support/fmeobjects/docs/pyfme/ Important Classes: FMEFeature & FMELogfile Used for creating Python apps Also used by PythonFactory
10
Customizing FME Translations with Python 10 Begin/End Python AKA Workbench “Startup/Shutdown” Python Scripts Run Python scripts before and after the FME translation Files executed in the __main__ namespace FME sets status & statistics variables Useful for performing custom workflow actions & reporting
11
Customizing FME Translations with Python 11 @Python Python fn accepts feature + arbitrary # of parameters Python fn returns string or none Ancient history: PythonCaller now uses PythonFactory
12
Customizing FME Translations with Python 12 PythonFactory Can be implemented using Python functions, classes, or instances Functions are single-in single-out Classes/Instances allow multiple-in multiple-out scenarios Much more flexible than @Python Can be used to create readers & writers work-alikes
13
Customizing FME Translations with Python 13 Workbench Goodies PythonCaller Transformer PythonCreator Transformer New “Advanced” Workbench Settings: Startup/Shutdown Python script parameters Wicked cool script editor
14
Customizing FME Translations with Python 14 Why use Python? Web Services Text parsing Custom algorithms Custom logging Readlets Friendlier scripting syntax
15
Customizing FME Translations with Python 15 Examples Available at http://safe.com/python
16
Customizing FME Translations with Python 16 Further Information Tom.Weir@safe.com Tom.Weir@safe.com http://www.safe.com/python http://www.safe.com/python Grab me anytime during the UC Ask me about: Python ;) KML FME Deployment (aka the installer) fmepedia.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.