caltechdata-api 2.2.2__tar.gz → 2.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/PKG-INFO +1 -1
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/caltechdata_write.py +9 -3
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api.egg-info/PKG-INFO +1 -1
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/pyproject.toml +1 -1
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/LICENSE +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/README.md +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/__init__.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/caltechdata_edit.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/cli.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/customize_schema.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/download_file.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/download_from_record.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/get_metadata.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/md_to_json.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/utils.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/date_types.yaml +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/description_types.yaml +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/identifier_types.yaml +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/licenses.csv +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/relation_types.yaml +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/resource_types.yaml +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/roles.yaml +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/title_types.yaml +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies.yaml +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api.egg-info/SOURCES.txt +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api.egg-info/dependency_links.txt +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api.egg-info/entry_points.txt +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api.egg-info/requires.txt +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api.egg-info/top_level.txt +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/setup.cfg +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/tests/test_download.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/tests/test_rdm.py +0 -0
- {caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/tests/test_unit.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: caltechdata_api
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: Python wrapper for CaltechDATA API.
|
|
5
5
|
Author: Rohan Bhattarai, Elizabeth Won
|
|
6
6
|
Author-email: Thomas E Morrell <tmorrell@caltech.edu>, Alexander A Abakah <aabakah@caltech.edu>, Kshemaahna Nagi <knagi@caltech.edu>
|
|
@@ -69,14 +69,19 @@ def write_files_rdm(
|
|
|
69
69
|
|
|
70
70
|
def add_file_links(file_upload_link, file_links, headers, keepfiles=False):
|
|
71
71
|
# Currently configured for S3 links, assuming all are at the same endpoint
|
|
72
|
+
# Links are urls, or (file name, url) pairs when the url file names are not
|
|
73
|
+
# unique across the bucket
|
|
72
74
|
link_string = ""
|
|
73
|
-
|
|
75
|
+
file_links = [
|
|
76
|
+
link if isinstance(link, (list, tuple)) else (link.split("/")[-1], link)
|
|
77
|
+
for link in file_links
|
|
78
|
+
]
|
|
79
|
+
endpoint = "https://" + file_links[0][1].split("/")[2]
|
|
74
80
|
s3 = s3fs.S3FileSystem(anon=True, client_kwargs={"endpoint_url": endpoint})
|
|
75
81
|
index = 0
|
|
76
82
|
file_json = []
|
|
77
83
|
f_list = []
|
|
78
|
-
for link in file_links:
|
|
79
|
-
file = link.split("/")[-1]
|
|
84
|
+
for file, link in file_links:
|
|
80
85
|
f_list.append(file)
|
|
81
86
|
path = link.split(endpoint)[1]
|
|
82
87
|
size = s3.info(path)["size"]
|
|
@@ -98,6 +103,7 @@ def add_file_links(file_upload_link, file_links, headers, keepfiles=False):
|
|
|
98
103
|
result = requests.delete(ex["links"]["self"], headers=headers)
|
|
99
104
|
if result.status_code != 204:
|
|
100
105
|
raise Exception(result.text)
|
|
106
|
+
|
|
101
107
|
result = requests.post(file_upload_link, headers=headers, json=file_json)
|
|
102
108
|
if result.status_code != 201:
|
|
103
109
|
raise Exception(result.text)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: caltechdata_api
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: Python wrapper for CaltechDATA API.
|
|
5
5
|
Author: Rohan Bhattarai, Elizabeth Won
|
|
6
6
|
Author-email: Thomas E Morrell <tmorrell@caltech.edu>, Alexander A Abakah <aabakah@caltech.edu>, Kshemaahna Nagi <knagi@caltech.edu>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/date_types.yaml
RENAMED
|
File without changes
|
{caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/description_types.yaml
RENAMED
|
File without changes
|
{caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/identifier_types.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/relation_types.yaml
RENAMED
|
File without changes
|
{caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/resource_types.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api/vocabularies/title_types.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{caltechdata_api-2.2.2 → caltechdata_api-2.2.3}/caltechdata_api.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|