Heidelberger Akademie der Wissenschaften

Skip to content

Uploaded fo_no.py (the Folio Numbering file).

Ragini Menon requested to merge raginimenon-main-patch-59961 into main

File renaming script

Algo

workflow

We take a folder with files that must be renamed (possible iterativerlly in the future) and make a work copy on which we rename according to our convention.

The files represent scans of documents and are named randomly,but linearly, so that we have consequent numbers that represent alternating front(recto) and back (recto) side of one sheet.

The folio numbers in the manuscripts are (almost) always on the recto page at the top center or top right, written by hand (in the Middle Ages). I.e. sometimes difficult to read).

We are numbering them completely for a clear order in eScriptorium ===> [laufendeNummer][tag][folionummer-automatisch][r/v-automatisch][durchlaufende_Nummer-automatisch] i.e. ===> 1-GuiChaul-1r; 2-GuiChaul-1v; 3-GuiChaul-2r; 4-GuiChaul-2v; 5-GuiChaul-3r; 6-GuiChaul-3v;

Challenge:

Since there are so many scans, it can happen that two pictures represent the same page, which would mean that the whole numbering would be faulty.

We are taking these repetitions into consideration and will name them accordingly (bis, tri, ...). Ideally we won't have more than 3 copies of one page

After renaming, the files will be proofread, possible duplicates will be identified the starting index and number of errors will be noted and fed as arguments for the function duplicates from folio_naming_corr.

Correction of duplicates:

User gives the page number where the false foliation starts and how many times the error repeats.

We take the page number (which in our new names comes after the last "-" in string) as an argument "false_fo_start", and change the name of the following "false_fo_val" files as follows: we add 1,2,... at the end of the original page name to show the number of the duplicate und take care to decrease t page number by "false_fo_val" after we are done with duplicates.

The process repeats until there are no more duplicates in the folder, and the user presses 0

Usage:

Copy the function fo_no.py on your computer. Install python 3.10.

Double click the fo_no.py file to start the renaming.

To only test how the renaming works, use the test_files folder and copy the inputs from the prompted message.

You will be asked to introduce the path of the folder containing the files to be renamed.

Please write the absolute path if the files aren't stored in the same directory as the scripts.

Else, just write "./" followed by the name of the folder.

Then you will have to type in the Siglum of the documents. For now we only do this one at a time.

Now you have renamed all the files and can go check for errors. Please write down the Folio number from which the wrong foliotation starts, and how many Folios are wrongly named.

I. e. in the following renaming 1-GuiChaul-1r; 2-GuiChaul-1v; 3-GuiChaul-2r; 4-GuiChaul-2v; 5-GuiChaul-3r; 6-GuiChaul-3v; we found that Folio 2 has 1 duplicate.

We rename to: 1-GuiChaul-1r; 2-GuiChaul-1v; 3-GuiChaul-2r; 4-GuiChaul-2v; 5-GuiChaul-2r1; 6-GuiChaul-2v1;

After revising the documents, you can press 1 to keep renaming other errors, or 0 to finish renaming.

Merge request reports

Loading