Skip to content

Commit d6890a4

Browse files
committed
Make script more flexible
1 parent 6dbe4aa commit d6890a4

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

add_files_authors.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1-
import requests, os
1+
import requests, os, argparse
22
from caltechdata_api import write_files_rdm
33

4-
idv = "tv53y-rqh37"
5-
files = ["1-s2.0-S2590162125000620-main.pdf"]
4+
parser = argparse.ArgumentParser(
5+
description="Add files to an existing CaltechAUTHORS record."
6+
)
7+
parser.add_argument(
8+
"idv",
9+
type=str,
10+
help="The CaltechAUTHORS record idv to edit.",
11+
)
12+
parser.add_argument(
13+
"files",
14+
type=str,
15+
nargs="+",
16+
help="The files to upload to the record.",
17+
)
18+
args = parser.parse_args()
19+
idv = args.idv
20+
files = args.files
621
token = os.environ["RDMTOK"]
722
url = "https://authors.library.caltech.edu"
823

0 commit comments

Comments
 (0)