...
I call this github archive “Fun with SAM”.
https://github.com/AndyArthur/nys_sam_geocoders/
It contains python code for geocoding addreses using the State Address Management system, and doing reverse geocoding and also figuring out what AD, SD, CD an address is in, although you can supply your own shapefile, to figure out what thing anything is located.
See also, a better geocoding script with SAM.