Skip to content

Instantly share code, notes, and snippets.

{
"id": "00000000-0000-0000-0000-000000000000",
"appSettings": [],
"bagItProfiles": [
{
"id": "1f1803ec-4230-491c-a0e5-0dec24c41edb",
"name": "Rockefeller Archive Center",
"description": "Default BagIt Profile for the Rockefeller Archive Center",
"acceptBagItVersion": [
"0.97",
@helrond
helrond / build_bags.py
Last active June 12, 2019 18:53
A script to build bags which validate against the BagIt spec and a BagIt Profile.
#!/usr/bin/env python
"""
A script to build bags which validate against the BagIt spec and a BagIt Profile.
Usage: build_bags.py [-h] [-t TARGET_DIR] [-b BAG_COUNT] profile_url source_dir
"""
import argparse
import bagit
@helrond
helrond / download_diaries.py
Last active May 30, 2019 02:46
Downloads all PDF files associated with a diarist
#!/usr/bin/env python
""""
Downloads all PDF files associated with a diarist
usage: download_diaries.py [-h] diarist target
diarist: URL for a diarist.
target: Directory into which PDFs will be downloaded.
"""
@helrond
helrond / downloads.json
Last active November 30, 2018 17:57
Downloads, and extracts an Archivematica DIP. Creates derivatives for objects and moves them to flat directory structure.
["2e41e5c2-c160-49ba-998e-cf0b830252be", "33b83ab9-52da-45bf-844e-e33406ca53e9", "4f8109b7-089b-459c-9db4-9b12ecc2ce3c", "5eb7e69a-6e2c-4bae-9465-2e75a445990b", "8a70f78b-6583-452f-b6b2-e3f87efef52b", "c9eb0981-3732-4282-8971-3ee4d4c5f6d0", "7a4fa374-5be2-4e23-b2e9-6d7dccb8ccbb", "b8fe2597-d35c-4cf3-ba49-2ecd5451532f", "d45215ee-f707-4a7b-a32d-af53b417ee80", "de5970b9-303e-4c37-b3a5-b10d9757dce7", "233592ac-3199-4aa5-a445-cc9e8819c61f", "6cad12f9-0948-4d67-868c-e41ab985d6bb", "1ccd7d15-067e-491f-ae52-746e398a5f1f", "23c6b2f6-373d-4084-96eb-ec5bfd4ef13e", "2d527e1a-bee0-4c19-bef1-587b20ccda53", "386a87de-9169-4b98-8e5c-c0e1ec87ec64", "490c9bac-fa41-4c10-bc28-3fea96fad8a5", "4b6078a5-fd70-4e9c-b7aa-6cc413e79ab2", "53d6a0f4-bc4d-40d9-8ca6-f19490c3e275", "5cf8a029-7481-4f30-bdfa-6fff5018c129", "6a37dea6-ae82-416c-8d3d-24c29a995f16", "8b15dd79-de2a-4ad3-9fb0-9aeaa8f1dbb5", "96000cf5-b832-4cc7-a87c-e6a8eb49e472", "a28a342e-4d98-42d4-9fa1-4c1daee84735", "a5d2438a-a962-40c5-8f9b-a67712554560", "a95064c4-f506-49c0-afb
require 'twitter_ebooks'
# This is an example bot definition with event handlers commented out
# You can define and instantiate as many bots as you like
class MyBot < Ebooks::Bot
attr_accessor :model, :model_path
# Configuration here applies to all MyBots
def configure
# Consumer details come from registering an app at https://dev.twitter.com/

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

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
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
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
}