Skip to content

Instantly share code, notes, and snippets.

linkfest experiment to grab <persnames> out of an EAD finding aid to
find matches in freebase
backend:war:
[java] Creating backend.war
[java] rm -f backend.war
frontend:clean:
[mkdir] Created dir: c:\Users\harnold\Documents\repos\archivesspace\frontend
\public\assets
[mkdir] Created dir: c:\Users\harnold\Documents\repos\archivesspace\frontend
\public\assets\00-do-not-put-things-here
@helrond
helrond / gist:4941971
Created February 13, 2013 03:12
Blacklight error with full trace
NoMethodError in Catalog#show
Showing C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/blacklight-4.0.1/app/views/catalog/show.html.erb where line #8 raised:
undefined method `[]' for nil:NilClass
Extracted source (around line #8):
5: <%= render 'previous_next_doc' %>
6:
7:
@helrond
helrond / gist:5510448
Created May 3, 2013 16:07
So it turns out there are lots of ways to unambiguously identify the levels of the hierarchy without numbered components.
<c level="Zeus">
<c level="Hera">
<c level="Poseidon">
<c level="Demeter">
<c level="Athena">
<c level="Hestia">
<c level="Apollo">
<c level="Artemis">
<c level="Ares">
<c level="Aphrodite">
@helrond
helrond / asExport.py
Last active August 29, 2015 14:08
A simple Python script to export EAD files using ArchivesSpace's API
#!/usr/bin/env python
import requests
import json
# the base URL of your ArchivesSpace installation
baseURL = 'Your URL here'
# the id of your repository
repository = 'Your repository id here'
# the username to authenticate with
class MODSSerializer < ASpaceExport::Serializer
serializer_for :mods
include JSONModel
def serialize_mods_inner(mods, xml)
xml.titleInfo {
xml.title mods.title
}
class MODSSerializer < ASpaceExport::Serializer
serializer_for :mods
include JSONModel
def serialize_mods_inner(mods, xml)
xml.titleInfo {
xml.title mods.title
}
ExportHelpers.module_eval do;
def generate_labels(id)
obj = resolve_references(Resource.to_jsonmodel(id), ['tree', 'repository', 'archival_object', 'parent'])
labels = ASpaceExport.model(:labels).from_resource(JSONModel(:resource).new(obj))
ASpaceExport::serialize(labels, :serializer => :tsv)
end
end
class LabelModel < ASpaceExport::ExportModel
ExportHelpers.module_eval do;
def generate_labels(id)
obj = resolve_references(Resource.to_jsonmodel(id), ['tree', 'repository'])
labels = ASpaceExport.model(:labels).from_resource(JSONModel(:resource).new(obj))
ASpaceExport::stream(labels)
end
end
class LabelModel < ASpaceExport::ExportModel
model_for :labels

Setting up agentarchives Python module

This document describes how to set up the agentarchives Python module as well as basic usage examples. Although these instructions relate specifically to the ArchivesSpace submodule, the general installation procedure is germane to both the ArchivesSpace and the Archivists Toolkit submodules.

Clone repository

git@github.com:artefactual-labs/agentarchives.git

Install module

cd agentarchives sudo python setup.py install