Skip to content

Commit c306017

Browse files
committed
RC for version 2.0
1 parent 9ddf04b commit c306017

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

caltechdata_api/caltechdata_edit.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ def caltechdata_accept(ids, token=None, production=False):
3737
url + "/api/records/" + idv + "/draft/review", headers=headers
3838
)
3939
if result.status_code != 200:
40-
result = requests.get(url+ "/api/records/" + idv + '/requests', headers=headers)
40+
result = requests.get(
41+
url + "/api/records/" + idv + "/requests", headers=headers
42+
)
4143
if result.status_code != 200:
4244
raise Exception(result.text)
43-
accept_link = result.json()["hits"]["hits"][0]["links"]["actions"]["accept"]
45+
accept_link = result.json()["hits"]["hits"][0]["links"]["actions"]["accept"]
4446
else:
4547
accept_link = result.json()["links"]["actions"]["accept"]
4648
data = comment = {
@@ -151,12 +153,12 @@ def caltechdata_edit(
151153
"Content-type": "application/octet-stream",
152154
}
153155

154-
#Add to community if provided:
156+
# Add to community if provided:
155157
if community:
156158
result = requests.post(
157159
url + "/api/records/" + idv + "/communities",
158160
headers=headers,
159-
data=json.dumps({"communities":[{"id": community}]}),
161+
data=json.dumps({"communities": [{"id": community}]}),
160162
)
161163
if result.status_code != 200:
162164
print(result.url)
@@ -332,7 +334,7 @@ def caltechdata_edit(
332334
)
333335
if file_links:
334336
ex_file = existing["files"]["entries"].keys()
335-
#At the moment we don't replace existing links. This needs to change
337+
# At the moment we don't replace existing links. This needs to change
336338
for link in file_links:
337339
file = link.split("/")[-1]
338340
if file not in ex_file:

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[metadata]
66
name = caltechdata_api
7-
version = 1.11.0
7+
version = 2.0.0
88
author = Thomas E Morrell, Rohan Bhattarai, Elizabeth Won, Alexander A Abakah, Kshemaahna Nagi
99
author_email = tmorrell@caltech.edu, aabakah@caltech.edu, knagi@caltech.edu
1010
description = Python wrapper for CaltechDATA API.

0 commit comments

Comments
 (0)