anonymize_1.py 454 B

1234567891011121314151617
  1. def main():
  2. load_pseudonyms()
  3. if len(sys.argv) > 1:
  4. for fn in sys.argv[1:]:
  5. filter_file(fn)
  6. else:
  7. dirList = os.listdir(os.path.dirname(sys.argv[0]))
  8. for fname in dirList:
  9. split = os.path.splitext(fname)
  10. if (split[1].lower() == '.csv' and split[0].upper()[:5] != 'ANON_'
  11. and split[0] != 'pseudonyms'):
  12. filter_file(fname)
  13. save_pseudonyms()