Code and helpers for managing ESRI Enterprise Geodatabases. It is our toil friends, our rules, the trick is never to be afraid.
- ArcGIS Pro installed (ie Python 3+)
- Database connectivity from this machine (ex 64 bit 19c Oracle client)
- An .sde file that connects to the geodatabase (externalize as %SDEFILE%)
To maximize test coverage execute as the geodatabase administrator ("sde") in a development environment. Copy sample-testall.bat to testall.bat and update the inputs.
> set SDEFILE=C:\XXX\Connections\xxx\env\xxx-xxxxxx\yyy.sde
> testall.bat
The code in this repo is mostly simple opinionated wrappers to arcpy geodatabase, feature class, and versioning functions.
For example, import a feature class from another geodatabase and enable versioning.
import gdb
import fc
targetfcname = 'TEST_TAXLOTS'
sourcefc = """C:/connections/prod.sde/TAXLOTS"""
# SET SDEFILE=C:\connections\dev.sde
targetgdb = gdb.Gdb()
targetgdb.importfeatureclass(sourcefc
,targetfcname)
targetfc = fc.Fc(targetgdb
,targetfcname)
targetfc.version()
See /src/py/test_*.py for more usage demonstrations.