^ [[Chronological Developments]]
On August 23rd, 2025, I drafted an Obsidian script in order to update this website programmatically. Things went smoothly enough, and I started a test directory in order to ensure that it went smoothly. This document organizes my thoughts.
## Minimum Viable Product
By August 24, 2025, I completed the M.V.P. of the process, which has the following functionality:
### Input
Takes Lightroom export of the form `&Serial Number&=Stop Number=keywords, separated, by, commas.jpg`
### Build initial image files, rename images, and generate source indices.
- Loops over the photos in the SOURCE directory with the following:
- Parses out the components of the source filename
- Generates SerialIndex keyword which is a list of form serialNumber, stopNumber
- Zeroes output
- Loops through the keyowrds in the following ways
- Extracts non programmatic (onPage, edited) keywords and formats into a -\[\[markdown link\]\]
- Appends each link to output
- Generates a full keyword/stop index of format keyword¿StopNumber
- Returns to main loop to:
- Build contents of output file
- Write output .md file
- Rename image to correct format
### Generate forward/next index
- Loops over lines in the serialIndex variable with the following:
- Captures the index number and current stop number to scoped variable
- Sets the forward index and backward index based on +1 and -1 respectively
- Finds previous and next stop within searchIndex variable based on the backward and forward index
- Generates stop ordering check based on the information found at previous/next index lines
### Write previous / next stop links to each file
- Loops over existing files in the source directory with the following:
- Gets file name, checks that it is a Stop Number___.md file, exits current loop if no, otherwise:
- Captures the stop number from the file name of current iteration
- Searches the search index for that stop, retrieves and parses the line for the previous / next stop information
- Reads file data from current iteration to variable
- searches for string `Last stop:` etc., and replaces it with the existing text as well as a markdown link for the previous/ next file
- Writes back to file
### Generate list of unique keywords with associated stops
- Loops over items in the verbose list of all keywords and the stop associated with:
- Parses the format into a local keyword / StopNum variable
- Searches an initially blank variable uniqueKeywords for a match of the keyword
- If match: Appends the existing keyword with additional stop at same line in unique Keyword list
- If no match: Appends new instance of a unique keyword and associated stop to unique Keyword list
- Output is a list of unique keywords and the stops associated with each keyword.
### Generate files for keywords and their associated stops
- Loops over the lines of Unique Keywords with the following:
- Parses each line into the keyword and a list of all stops associated with keyword
- Initializes a formatted header for output file
- Breaks a comma separated list into a single variable with a line for each stop
- Iterates over the lines of the stop list with the following
- Filters whitespace from the keyword
- Appends each line to the initialized header
- Returns to main logic
- With output from initialized header and each appended line, writes to new file with name of keyword as title.
## Extension scope: Checking / updating existing files
Here are some notes for what I need a check/update version to do:
### Input
- Takes the same input in formatted Lightroom export of the entire body of photographs.
- Should also work with only a partial export of photographs.
- Updates start in directory, move to a live directory
### Goals
- Displace original picture files with equivalent photos of the same name.
- Read contents of Stop files
- Update the keyword list in stop files (just regenerate the list from scratch?)
- Needs to leave intact if no changes
- Needs to delete any keywords not present
- Needs to append any new keywords
- Respect everything else in the top files
- Append keyword files with new keyword / images (i.e. unmatched in existing file)
- Respect any text between the linked files which currently exists in keyword files.
- Create new keyword files if new keywords are found.
### Advantages
- Do not need any serialization information **as long as new photographs are not added.**
### Necessary bits
- Iterate through all the keyword files to generate list of existing keywords
### Roadmap
- Build the capacity to capture and parse all information above for a single file
- Create indexes of the files based on target directory, sort out Stop Number files and keyword files.
### Tests
- Test set of 15 photos against current body of photographs
- Create "safe directory" copy so that I don't have to rebuild the directory from scratch each time.
- ~~Check the following photographs for new keywords (they have no existing keywords in the current export)~~
- ~~87Bypass.jpg~~
- ~~726.jpg~~
- ~~853.jpg~~
- ~~876.jpg~~
- ~~877.jpg~~
- ~~949.jpg~~
- ~~1186.jpg~~
- ~~1247.jpg~~
- ~~1248.jpg~~
- ~~1577.jpg~~
- ~~1780.jpg~~
- ~~1970.jpg~~
- ~~3341.jpg~~
- ~~3342.jpg~~
- ~~oldStop.jpg~~
- ~~Check the following photographs for added keywords~~
- ~~3680-2~~
- ~~Added "foreboding elements, geometric stuff"~~
- ~~Check that the following page had keyword removed:~~
- ~~3680-2~~
- ~~Removed "Sunset"~~
- Check that following photos get removed from existing page:
- Sunset
- 3680-2
- Architecture
- 461
- NoStop-7
- Dead Tree
- 548
- Sunrise
- 548
- Check that the following keyword pages get created:
- Ford
- Uncertain Fruit
- Some keywords that will be update:
- Crate Myrtle
- Map
- Mural
- No Outlet
- Check that static contributor keylist has only one Fence
## Maintaining version 2
- Currently some sort of bug where all keyword stops are getting appended to the existing keyword pages. Not sure why. It looks like it's appending **ANY** changed file to the keyword file. Also seems to be whitespace issue in these exact file names (i.e. `Stop Number _ _ 12345`)
## Throwing out the whole shebang
I think it's probably going to be easier to generate the whole project from scratch after keywording all the images I want to keyword. I only have about 350 more to keyword and generating the file structure from scratch is probably going to be a lot simpler than trying to write exceptions for every possible configuration of text and image found throughout this website.
## Newest Version
Improved my python skills and made a small script that does everything described above just more durably and elegantly. The first one seemed basically to work by accident rather than design.