Skip to content

Instantly share code, notes, and snippets.

View meau's full-sized avatar

Maureen Callahan meau

View GitHub Profile
SELECT
*
FROM
(SELECT
accession.id
FROM
accession) AS A
LEFT JOIN
(SELECT DISTINCT
accession.id
SELECT
count(*)
FROM
(SELECT
accession.id
FROM
accession) AS A
LEFT JOIN
(SELECT DISTINCT
accession.id
SELECT
COUNT(DISTINCT accession.id)
FROM
accession
JOIN
linked_agents_rlshp ON linked_agents_rlshp.accession_id = accession.id
LEFT JOIN
agent_person ON linked_agents_rlshp.agent_person_id = agent_person.id
LEFT JOIN
agent_corporate_entity ON linked_agents_rlshp.agent_corporate_entity_id = agent_corporate_entity.id
SELECT
CONCAT('https://archivesspace.smith.edu/accessions/',
accession.id) 'accession URL',
repository.repo_code repository,
accession.title 'accession title',
accession.identifier 'accession ID',
accession.accession_date 'accession date',
accession.create_time 'record creation date',
accession.created_by 'record creator',
CONCAT(name_person.primary_name,
import shutil, os
with open('files.txt', 'r') as images:
myImages = {line.strip() for line in images}
print myImages
dir_src = r"/Volumes/nas/SSC-CAImages/ArchivalTIFF"
dir_dst = r"/Users/mcallahan/Desktop/PPImages"
for dirpath, dirs, files in os.walk(dir_src):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ead="urn:isbn:1-931666-22-9" version="2.0">
<xsl:strip-space elements="*"/>
<!-- standard identity template, which does all of the copying -->
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
SELECT
CONCAT('/resources/', r.id) 'resource URL',
repo.repo_code,
r.identifier,
r.title,
cm.processing_hours_per_foot_estimate,
cm.processing_total_extent,
cm.processing_hours_total,
cm.processing_plan,
pp.value 'processing priority',
SELECT
CONCAT('/accessions/', a.id) 'accession URL',
repo.repo_code,
a.identifier,
a.display_string,
a.content_description,
a.condition_description,
a.disposition,
a.inventory,
a.provenance,
SELECT
CONCAT('/accessions/', a.id) 'accession URL',
repo.repo_code,
a.identifier,
a.display_string,
a.content_description,
a.condition_description,
a.disposition,
a.inventory,
a.provenance,
UPDATE mssa.archdescriptioninstances
SET
container2AlphaNumIndicator = RIGHT(container1AlphaNumIndicator,
LOCATE('F', container1AlphaNumIndicator) - 2),
container1AlphaNumIndicator = LEFT(container1AlphaNumIndicator,
LOCATE('F', container1AlphaNumIndicator) - 1),
container2Type = 'Folder'
WHERE
container1AlphaNumIndicator LIKE '%CS%'