commit fe1c4b27baab834dc16d4a145fee1de603687228 Author: Kjistóf Date: Thu Dec 8 18:15:56 2016 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c10666e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +*.pyc diff --git a/normalisename.py b/normalisename.py new file mode 100644 index 0000000..31df1b1 --- /dev/null +++ b/normalisename.py @@ -0,0 +1,15 @@ +from sys import argv +from os import rename +from unidecode import unidecode + + +for file in argv[1:]: + rename(file, + unidecode + ( + ''.join(ch for ch in file + if ch.isalnum() + or ch is ' ' + or ch is '.') + ) + .replace(' ', '_')) \ No newline at end of file