try:
    pdfpath = sys.argv[1]
except IndexError:
    pdfpath = os.curdir
employees = {(1): 'Bob', (2): 'Joe', (3): 'Sara'}
files = [f for f in os.listdir(pdfpath) if re.match(
    'BusinessCard_[0-9]+_Blue.pdf', f)]
idnumbers = [int(re.search('[0-9]+', f).group(0)) for f in files]
filenamemap = zip(files, [employees[i] for i in idnumbers])
newfiles = [re.sub('Blue.pdf', e + '_Blue.pdf', f) for f, e in filenamemap]
for old, new in zip(files, newfiles):
    shutil.move(os.path.join(pdfpath, old), os.path.join(pdfpath, new))
Пакетное переименование файлов — вставка текста из списка (в Python или Java)