This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) |
This file contains hidden or 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 = "https://www.wikidata.org/wiki/Special:EntityData/" | |
| qnumbers = ['Q43260736', 'Q51827254', 'Q56471556'] | |
| all_properties = {} | |
| for qnum in qnumbers: |
This file contains hidden or 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 bs4 import BeautifulSoup | |
| import json | |
| # with open('all_eps.json','r') as out: | |
| # all_eps = json.load(out) | |
| all_eps = json.load(open('all_eps.json')) | |
| all_tweets = [] |