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 requests | |
import json | |
url = "http://data.carnegiehall.org/sparql/" | |
sparql = """ | |
#Find works by string in the title (case-insensitive) | |
PREFIX dcterms: <http://purl.org/dc/terms/> | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> |
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 requests | |
from bs4 import BeautifulSoup | |
import json | |
all_item_urls = [] | |
counter = 1 | |
while counter <= 609: |
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 requests | |
import json | |
with open('key.json') as keyfile: | |
key_data = json.load(keyfile) | |
api_key = key_data['key'] | |
#mediums_i_want = ["2028333","2028206","2028902","2035812","2028183","2035306"] | |
mediums_i_want = ["2028216"] |
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 requests | |
import json | |
with open("key.json") as keyjson: | |
key = json.load(keyjson) | |
def archive_search(keyword,limit=20,offset=0,total_only=0): | |
url = "https://www.brooklynmuseum.org/api/v2/archive/image/" | |
headers = { |
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
{ | |
"@context": { | |
"identifiers": "http://id.loc.gov/vocabulary/identifiers/", | |
"madsrdf": "http://www.loc.gov/mads/rdf/v1#", | |
"owl": "http://www.w3.org/2002/07/owl#", | |
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", | |
"rdfs": "http://www.w3.org/2000/01/rdf-schema#", | |
"ri": "http://id.loc.gov/ontologies/RecordInfo#", | |
"skos": "http://www.w3.org/2004/02/skos/core#", | |
"xsd": "http://www.w3.org/2001/XMLSchema#", |
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 requests | |
import xml.etree.ElementTree as ET | |
import json | |
import multiprocessing | |
answer_urls = [] | |
def do_work(url): | |
print(url) | |
urls = [] |
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 json | |
with open('subjects.json') as infile: | |
data = json.load(infile) | |
geo_lookup = {} | |
for record in data: |
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 json | |
import csv | |
import glob | |
# we need to know the headers, not all files may have all headers so make a big list first | |
headers = [] | |
for filename in glob.glob("exhibitions/*.json"): | |
with open(filename, "r") as data: | |
json_file = json.load(data) |
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 requests | |
import json | |
import time | |
key = 'YOURKEYHERE' | |
url = 'https://maps.googleapis.com/maps/api/place/nearbysearch/json' | |
all_data = {} |
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 | |
artsts = ["Salvador Dalí", "May Ray", "Giorgio de Chirico", "Pablo Picasso", "Marcel Duchamp", "Francis Picabia", "André Masson", "Joan Miró", "Joan Miró", "René Magritte", "Paul Delvaux", "Yves Tanguy", "Matta", "Frida Kahlo", "Diego Rivera", "Diego Rivera", "Dorothea Tanning", "Leonora Carrington", "Hans Bellmer", "Roland Penrose", "Stella Snead", "Jean Arp", "Luis Buñuel", "Bridget Bate Tichenor", "Toyen", "Leonor Fini", "Dora Maar", "Kay Sage"] | |
with open("data/MetObjects.csv", "r") as artwork_csv: | |
processed_csv = csv.reader(artwork_csv) |