Schedule to run Spatial ETL tool automatically

4903
5
05-14-2015 10:50 AM
SrijanaTuladhar
New Contributor III

I have a ETL tool that transform our data into a different data model, I would like to run automatically on a weekly basis. Can I convert it to python script? Thanks in advance!

0 Kudos
5 Replies
ToddBlanchette
Occasional Contributor II

I've never tried myself, but wouldn't it be easier to just write something quick in Python that runs your existing tool, instead of trying to convert everything to Python?

0 Kudos
SrijanaTuladhar
New Contributor III

Absolutely and that is what I am trying to figure out. Thanks!

0 Kudos
ToddBlanchette
Occasional Contributor II

Does this help?  Not sure what flavour of Spatial ETL tools you're running.

Run an FME Workspace from Python using FMEWorkspaceRunner | FME Samples and Demos

Once the Python is written, just have your Windows Task Scheduler call the Python file at whatever interval/time frame you choose.

0 Kudos
SrijanaTuladhar
New Contributor III

Thanks. I found this and I am trying to have a similar simple python script.

Schedule a Spatial ETL Tool

Run your ETL tool and from the results window right click the result and copy it as a Python snippet.

Then create a standalone Python script that imports arcpy and imports the toolbox, before executing the snippet, like:

import arcpy

arcpy.ImportToolBox(r'C:\Temp\NEARBug.gdb\NEARBug')

arcpy.SpatialETLTool("'C:/Work/Product Management/Loqate/Loqate.gdb'","geodatabase")

I will let you know if this works for me.

0 Kudos
SteveSchunzel
New Contributor III

Be sure that you're running the 32 bit Python executable.  I have a batch file that calls this version, then my script like below:

C:/Python27/ArcGIS10.4/python.exe myscript.py

Otherwise, I'd receive a "AttributeError: 'module' has no attribute when calling Spatial ETL tool" error.

0 Kudos