Schedule to run Spatial ETL tool automatically

4306
5
05-14-2015 10:50 AM
Highlighted
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!

Reply
0 Kudos
5 Replies
Highlighted
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?

Reply
0 Kudos
Highlighted
New Contributor III

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

Reply
0 Kudos
Highlighted
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.

Reply
0 Kudos
Highlighted
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.

Reply
0 Kudos
Highlighted
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.

Reply
0 Kudos