Tuesday, 26 February 2019

Python Scripting: Planned Scripting Projects

I've written a few posts about different scripts I am planning to look at. At the moment the ones that are most important are:
  1. A script to do segmented layer fractions for NZ Rail Maps. I am doing this very slowly and laboriously with a spreadsheet and keep making mistakes and having to paste things into files by hand, it does work but is a real drudge to do as the steps bring in a lot of mistakes inherently. This one is a bit more tricky than some of the other ones I am looking at as it has to have multiple input parameters either from a popup dialog(s) or command line parameters. The idea is it will write out the segment jgw files itself so therefore saving a whole lot of manual steps. To get a popup you need a third party library and EasyGUI is the one I am looking at.
  2. A script to auto rename my photos off the cameras from IMG_XXXX to the format I name them as which incorporates date/time and camera name. This script has to be able to read the EXIF tags and a third party library will be needed, then rename the files directly. 
  3. A script to auto sync video and music folder trees as previously mentioned. Needs to call ffmpeg for which there is not a python API, instead it is being called command line style. A native API is always best for interfacing. There are some third party libraries that may be able to interface it.
Scripting is not something I spend a lot of time doing but I shall need to start working on all of these ideas fairly soon as the needs of them are all pressing. At the moment various manual steps are used to get these tasks done and a lot of it is very slow.

On the other hand copyfiles.py and movefiles.py for copying raster layers for the maps have been a great success much better than the system I used before which was half script and half manual process that was time consuming and doing my first ever python scripting has been a great move forward.