This repository contains the code to build a searchable interface for museum collections that are stored in a PastPerfect database. A working model based on collections from the University Museum of the New Mexico State University can be found here.
Note Several key parts of the project data are not included in this repository. There are two reasons for this: 1) some of the data stored in museum databases are sensitive and not appropriate for public display, 2) the original uncompressed images are large and would clutter the repository. Users wishing to implement this tool will need to supply: 1) a PastPerfect object export file and 2) the corresponding
Images
directory from PastPerfect.
- Clone the repository
- Within the project root, create the following directories:
data/
data/images_full/
data/images_thums/
data/tables
- Export the Object List from PastPerfect following these guidelines.
- Save the export output as an
.xlsx
file and place it into./data/tables
directory created above. - From PastPerfect, copy the
Images
directory into the./data
directory such that it is./data/Images
. - Within the
index.qmd
file, navigate to thedata-read
chunk, and find the line that readsdf <- read_excel(here::here("data/tables/EXPORTED_FILE_NAME.xlsx")) %>% janitor::clean_names()
. - In this line of code, insert the name of the export file that was saved to
./data/tables
. It is suggested to use a date stamped file name likeinventory_2022_10_26.xlsx
but any name should work. - While developing the site it is recommended to sample the records. To do this, navigate to the code chunk called
df-sample
and seteval: true
and then select the sample size underslice_sample(n=XX)
. When you want to render the entire table, seteval: false
for thedf-sample
code chunk. - When you want to observe the output, render the project. Be prepared that large collections with lots of images may take some time. On my machine, with 16 gigs of RAM, rendering ~4,200 objects takes about an hour. Prolonged render times is one of the reasons to sample during development.
- After rendering, it is a good idea to compress the images in the output
_site
directory. This will reduce the load for users and save space on the server. For this task, the Caesium Image Compressor is recommended (though this could also be done withmagick
). I found that JPG compression of 75 works well. - After image compression, the site is ready to send to the server.
- Small projects can be posted to Quarto Pubs with the terminal command:
quarto publish quarto-pub --no-render
. If you want to re-render at publish, leave off the last argument. - Larger projects can be rendered to Netlify with the terminal command:
quarto publish netlify --no-render
. If you want to re-render at publish, leave off the last argument. - Alternatively, the contents of the
_site
directory can be pushed to any web server. This is what we've done withunivmuseum.nmsu.edu
. - Further customization options are documented at Quarto and
DT
.