This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rifleman George Abbott (service number 41461), killed in action. View his record on #OnlineCenotaph: https://aucklandmuseum.com/war-memorial/online-cenotaph/record/C4 | |
Private Francis Joseph Aisher (service number 40098), killed in action aged 21. View his record on #OnlineCenotaph: https://aucklandmuseum.com/war-memorial/online-cenotaph/record/C85 | |
Private William Allan (service number 38925), killed in action aged 33. View his record on #OnlineCenotaph: https://aucklandmuseum.com/war-memorial/online-cenotaph/record/C164 | |
Gunner George Robert Allard (service number 12893), killed in action aged 21. View his record on #OnlineCenotaph: https://aucklandmuseum.com/war-memorial/online-cenotaph/record/C165 | |
Private Edward John Allen (service number 32494), killed in action aged 23. View his record on #OnlineCenotaph: https://aucklandmuseum.com/war-memorial/online-cenotaph/record/C176 | |
Private Eric Charles Allison (service number 27431), killed in action. View his record on #OnlineCenotaph: https://aucklandmuseum.com/wa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint as pp | |
import settings, json, csv, codecs, cStringIO, requests | |
# Get API key from local file settings.py | |
key = settings.DNZ_API_KEY | |
# Define content partner names as variables | |
# This is to get around encoding of macron in AAG name | |
AAG = 'Auckland Art Gallery Toi o T'+unichr(257)+'maki' | |
AM = 'Auckland War Memorial Museum Tamaki Paenga Hira' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"message": "success", | |
"ships" : [ | |
{ | |
"name": "Limerick", | |
"horses": 348, | |
"men": 495 | |
}, | |
{ | |
"name": "Arawa", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX am: <http://collections.aucklandmuseum.com/ontology/core/> | |
#SELECT (COUNT(?num) AS ?count) WHERE { | |
SELECT ?record WHERE { | |
?record am:accessionNumber ?num. | |
FILTER strstarts(?num,'2019.62') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
count = 0 | |
# Load csv as Pandas dataframe, set number of rows in each file to 9000 | |
df = pd.read_csv('bigfile.csv', iterator=True, chunksize=9000) | |
# Iterate over each chunk | |
for chunk in df: | |
# Set output file name, appending count variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Auckland Museum Vernon AV file-size checker | |
# February 2020 | |
# Expects a list of Vernon AV IDs in a .csv. Checks image file sizes, | |
# outputting a .csv that identifies images as either: | |
# (a) a "not yet created" placeholder, or | |
# (b) a "not available" placeholder, or | |
# (c) a correctly processed image (with a note of its size) | |
import csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import requests | |
import pandas | |
import time | |
from collections import namedtuple | |
from tqdm import tqdm | |
# Takes a .csv of API IDs, which are manipulated to URLs below | |
# Outputs a .csv | |
infile = "IDs.csv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
substring(value, lastIndexOf(value, "record/")+7, lastIndexOf(value, "\" ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml | |
import requests | |
import json | |
import flickrapi | |
import webbrowser | |
from pprint import pprint as pp | |
config_file = 'auth.yaml' | |
with open(config_file, 'r') as config_file: | |
config = yaml.safe_load(config_file) |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"photos" : [ | |
{ | |
"title" : "Kari Mako [Korimako] Mahurangi N.Z.", | |
"img_url" : "https://live.staticflickr.com/65535/48753450128_7f7090bcbd_k.jpg", | |
"flickr_url" : "https://flickr.com/photos/182826961%40N04/48753450128", | |
"record_url" : "https://www.aucklandmuseum.com/collections-research/collections/record/am_library-paintinganddrawings-202", | |
"width" : 4000, | |
"height" : 6000, | |
"darkmode" : false |
OlderNewer