gpf.cursors module

This module contains fast and user-friendly alternatives to Esri’s standard cursors. The SearchCursor, InsertCursor and UpdateCursor listed here inherit from Esri’s Data Access cursors, but there are some differences:

  • SearchCursors return _Row wrappers and have a getValue() function, similar to Esri’s legacy rows;
  • Insert- and UpdateCursors return _MutableRow wrappers that also have a setValue() function, similar to their legacy predecessors;
  • The getValue() function can return a default value when the field was not found;
  • The cursors where_clause argument also accepts a gpf.tools.queries.Where instance.

In theory, one should be able to simply replace the legacy Esri cursors (in some script, for example) with the ones in this module without too much hassle, since all old methods have been ported to this module. The only thing you might need to replace and verify for compatibility is the call to the actual cursor itself.