We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
"num" | |
"type" | |
"naId" | |
"authority" | |
"authority.topicalSubject" | |
"authority.topicalSubject.naId" | |
"authority.topicalSubject.termName" | |
"authority.topicalSubject.isPreferred" | |
"authority.topicalSubject.isUnderEdit" | |
"authority.topicalSubject.isReference" |
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, json, csv, re, string, argparse | |
logfile = 'fields.csv' | |
offset = 0 | |
while offset < 6000 : | |
r = requests.get('https://catalog.archives.gov/api/v1?type=topical-subject&rows=200&offset=' + str(offset)).text | |
r = re.sub('( *)(\"@user.*?)\"\$\"',r'\1\2\n\1"$"', r) | |
m = string.split(r, '\n') |
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, json, csv | |
r = json.loads(requests.get('https://catalog.archives.gov/api/v1?naIds=10534724').text) | |
for key0 in r['opaResponse']['results']['result'][0].keys(): | |
print key0 | |
try: | |
for key1 in r['opaResponse']['results']['result'][0][key0].keys(): | |
print key0 + '.' + key1 | |
try: |
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, json, argparse, random, os, Tkinter | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--naid', dest='naid', metavar='NAID', | |
action='store') | |
parser.add_argument('--tag', dest='tag', metavar='TAG', | |
action='store') | |
parser.add_argument('--user', dest='user', metavar='USER', | |
action='store') |
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 ttk, json, requests, PIL, os | |
from Tkinter import * | |
from ttk import Frame, Style | |
from PIL import Image, ImageTk | |
def topic(*args): | |
topics = topictext.get() | |
image = json.loads(requests.get('https://uat.research.archives.gov/api/v1/?resultTypes=object&rows=200&description.item.scopeAndContentNote=' + topics).text) | |
total = image['opaResponse']['results']['total'] - 1 | |
if total > 199 : |
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
{ | |
"opaResponse":{ | |
"header":{ | |
"@status":"200", | |
"time":"2015-03-12T23:33:56.039Z", | |
"request":{ | |
"@action":"save", | |
"@path":"\/api\/v1\/id\/7000802\/tags", | |
"format":"json", | |
"pretty":true, |
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, json, os, csv, argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--file', dest='file', metavar='FILE', | |
action='store') | |
args = parser.parse_args() | |
file = args.file | |
newfile = 'NAIDs - ' + args.file |
NewerOlder