Small Python tool for cleaning output of pgsql2shp
Thomas Kandler db06392d94 Update README.md 6 years ago
README.md Update README.md 6 years ago
clean_pgsql2shp_output.py Create clean_pgsql2shp_output.py 6 years ago

README.md

pgsql2shp-cleaner

Small Python tool for cleaning output of pgsql2shp. As the export function of pgsql2shp is writing DBF files even if there is no data in the source it tends to create quite messy folders. This little script will look for empty DBF files and deletes them as well as associated files.

Use case: you got a lot of DB-views which need to be exported to SHP (e.g. for checking by non-DB folks); those views can be empty or not (empty = no error; some data = errors found); the empty ones can be discarded

Dependencies

dbf package; use e.g. pip install dbf to install

Use

  • drop in folder with DBF, SHP, SHX, etc. files
  • run in console

Todo

  • add parameter for directory path to clean
  • add parameter for additional extensions (is this needed?)