使用pyQT5, pyPDF2批量重命名论文的小工具
用于处理计算机类的英文文献,默认pdf info中title为空的文献来自于arxiv(arxiv上的文献,属性中只有一个时间戳,因此需要从文档内容中提取论文名,作者)
选择一个路径,之后
批量重命名该路径下的论文格式为:
论文名称[作者][会议/期刊名/arxiv编号]
paper-renamer-qt5.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QWidget, QGridLayout, QPushButton, QApplication, QLabel, QHBoxLayout, QVBoxLayout, QFileDialog, QMessageBox
from PyQt5.QtGui import QIcon
import os
from shutil import copy2
from PyPDF2 import PdfFileReader, PdfFileWriter
import re
class Pdf_Renamer(QWidget):
def __init__(self):
super().__init__()
self.dir = ""
self.initUI()
def initUI(self):
openButton = QPushButton("打开文件夹")
openButton.clicked.connect(self.openFolder)
self.pathLabel = QLabel("未选择文件夹", self)
startButton = QPushButton("开始批量重命名")
startButton.clicked.connect(self.renamer)
line1 = QHBoxLayout()
line1.addWidget(openButton)
line2 = QHBoxLayout(