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
# for python 3.5 | |
# takes a list of identifiers and exports a csv containing various metadata | |
# and status info from archive.org | |
# | |
# for use with IA lists scraped from catalogs of the users and the TT-Scribe | |
# (can also work with lists sent to Jye if we want to see how many are still | |
# not scanned) | |
# | |
# in the future maybe I can figure out how to take the results and auto-update the Access DB | |
# could clean up/simplify the code for sure |
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
REM first make a list of the directories | |
for /d %%A in (*) do echo %%~A>>temp.txt | |
REM then send each directory to bagit to baginplace | |
forfiles /C "cmd /c if @isdir==TRUE cd /d C:\bagit-4.9.0\bin\ & bag baginplace @path --payloadmanifestalgorithm sha1 --tagmanifestalgorithm sha1 --version 0.97 --verbose & move /-y @path Z:\archival_master_files\books\general_collection" | |
REM oh and then edit the files list to drop the "master" part | |
REM this find/replace code via https://social.technet.microsoft.com/Forums/scriptcenter/en-US/57bd676c-e5c3-4829-bdbf-6addea238bf0/find-and-replace-string-in-a-file-using-batch-script?forum=ITCG | |
@echo off | |
set "textfile=temp.txt" | |
set "newfile=filelist.txt" | |
set Scr="%temp%\TempVBS.vbs" |
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 internetarchive import get_item | |
import pycurl | |
import json | |
from io import BytesIO | |
def getFileInfo(x): | |
info = 'n/a' | |
files = get_item(x).files | |
for z in files: |
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 os | |
from tkinter.filedialog import askdirectory | |
from tkinter import messagebox | |
from sys import exit | |
from shutil import rmtree | |
def get_immediate_subdirectories(a_dir): | |
# stackoverflow.com/questions/800197/how-to-get-all-of-the-immediate-subdirectories-in-python#800201 | |
return [name for name in os.listdir(a_dir) | |
if os.path.isdir(os.path.join(a_dir, name))] |
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
# ################################################## | |
# | |
# python3 program to prepare for Internet Archive upload of PDFs and MARC records | |
# this will do the following: | |
# 1. create a list of identifiers from a folder of PDFs; | |
# 2. make sure MARC records exist with the same identifiers (stopping on mismatches) | |
# 3. pull MARC records into the same directory and rename them to IA convention | |
# 4. generate a spreadsheet called upload.csv to use with IA command-line tool | |
# | |
# TO DO: |
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
# adapted from https://github.com/asl2/PyZ3950/blob/master/example/zmarc_example.py | |
# for python2 [i couldn't get PyZ3950 to work in 3] | |
# this is a basic code to: | |
# - read bib record numbers from a csv spreadsheet 'worksheet.csv'; | |
# - run z39.50 query and save MARC records locally; and | |
# - rename them according to the second column in spreadsheet | |
# | |
# PyZ3950 found at https://github.com/asl2/PyZ3950 | |
# and requires PLY found at http://www.dabeaz.com/ply/ | |
# |
NewerOlder