This is a fork of giorginolab/zotfile_doctor which adds djvu support.
Zotfile is an extension for Zotero reference manager software which maintains an organized directory of literature PDF files.
This small script checks the consistency between Zotfile's file storage and the corresponding Zotero's view.
It compares the annotations stored in zotero.sqlite
file with the
PDF files in your chosen Zotfile directory. Both should be passed as
arguments. The output should be self-explanatory. It does not modify
the files nor the zotero DB. If you want to do clean-ups, you should
do it yourself.
Python 3.5 or higher.
Display differences only
python zotfile_doctor.py zotero.sqlite zotfile_directory
Display disfferences and clean zotfile directory
python zotfile_doctor.py zotero.sqlite zotfile_directory -c
There were 2 files in DB but not in zotfile directory:
Statistics/Socio/Herrera et al_2010_Mapping the Evolution of Scientific Fields.PDF
[...]
There were 8 files in zotfile directory but not in DB:
MD/MM-PBSA/Chen et al_2016_Assessing the performance of the MM-PBSA and MM-GBSA methods.pdf
[...]
These issues
- jlegewie/zotfile#96
- https://forums.zotero.org/discussion/41179/zotfile-does-not-delete-pdf-files-when-a-database-entry-is-deleted
- Files not ending in
.pdf
will be false positives (which includes capitalized.PDF
etc.). - Zotero must be closed (a locked DB can't be opened).
- Current as of 9/2019. May stop working if Zotero's internal storage format changes.
- Syncing case-insensitive filesystems occasionally causes confusion (not a problem originated by this script though).
Toni Giorgino, <www.giorginolab.it>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.