cldfzenodo 2.1.2__tar.gz → 2.2.0__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.
- {cldfzenodo-2.1.2/src/cldfzenodo.egg-info → cldfzenodo-2.2.0}/PKG-INFO +16 -4
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/setup.cfg +1 -1
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo/__init__.py +1 -1
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo/record.py +10 -3
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0/src/cldfzenodo.egg-info}/PKG-INFO +16 -4
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo.egg-info/entry_points.txt +0 -1
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/tests/test_record.py +1 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/LICENSE +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/MANIFEST.in +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/README.md +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/pyproject.toml +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/setup.py +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo/api.py +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo/commands/__init__.py +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo/commands/download.py +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo/oai.py +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo/search.py +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo.egg-info/SOURCES.txt +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo.egg-info/dependency_links.txt +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo.egg-info/not-zip-safe +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo.egg-info/requires.txt +7 -7
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/src/cldfzenodo.egg-info/top_level.txt +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/tests/test_api.py +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/tests/test_cli.py +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/tests/test_integration.py +0 -0
- {cldfzenodo-2.1.2 → cldfzenodo-2.2.0}/tests/test_legacy.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cldfzenodo
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Functionality to retrieve CLDF datasets deposited on Zenodo
|
|
5
5
|
Home-page: https://github.com/cldf/cldfzenodo
|
|
6
6
|
Author: Robert Forkel
|
|
@@ -26,10 +26,24 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
|
26
26
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
27
27
|
Requires-Python: >=3.8
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: clldutils
|
|
31
|
+
Requires-Dist: pycldf>=1.30.0
|
|
32
|
+
Requires-Dist: nameparser
|
|
33
|
+
Requires-Dist: attrs
|
|
29
34
|
Provides-Extra: cli
|
|
35
|
+
Requires-Dist: cldfbench; extra == "cli"
|
|
30
36
|
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: flake8; extra == "dev"
|
|
38
|
+
Requires-Dist: wheel; extra == "dev"
|
|
39
|
+
Requires-Dist: build; extra == "dev"
|
|
40
|
+
Requires-Dist: twine; extra == "dev"
|
|
31
41
|
Provides-Extra: test
|
|
32
|
-
|
|
42
|
+
Requires-Dist: cldfbench; extra == "test"
|
|
43
|
+
Requires-Dist: pytest>=5; extra == "test"
|
|
44
|
+
Requires-Dist: pytest-mock; extra == "test"
|
|
45
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
46
|
+
Requires-Dist: coverage>=4.2; extra == "test"
|
|
33
47
|
|
|
34
48
|
# cldfzenodo
|
|
35
49
|
|
|
@@ -167,5 +181,3 @@ via
|
|
|
167
181
|
```python
|
|
168
182
|
cldf = API.get_record(doi='...').download_dataset('my_directory')
|
|
169
183
|
```
|
|
170
|
-
|
|
171
|
-
|
|
@@ -7,7 +7,7 @@ from cldfzenodo.api import *
|
|
|
7
7
|
from cldfzenodo import oai
|
|
8
8
|
from cldfzenodo import search
|
|
9
9
|
|
|
10
|
-
__version__ = '2.
|
|
10
|
+
__version__ = '2.2.0'
|
|
11
11
|
# flake8: noqa
|
|
12
12
|
|
|
13
13
|
# -------------------------------------------------------------------------------------------------
|
|
@@ -153,6 +153,7 @@ class Record:
|
|
|
153
153
|
closed_access = attr.ib(default=False, validator=attr.validators.instance_of(bool))
|
|
154
154
|
version = attr.ib(default=None)
|
|
155
155
|
concept_doi = attr.ib(default=None)
|
|
156
|
+
metadata = attr.ib(default=attr.Factory(dict))
|
|
156
157
|
|
|
157
158
|
def __attrs_post_init__(self):
|
|
158
159
|
if not self.download_url:
|
|
@@ -188,6 +189,7 @@ class Record:
|
|
|
188
189
|
concept_doi=d.get('conceptdoi'), # There are old records with "concept_rec_id" ...
|
|
189
190
|
# FIXME: Check Zenodo API periodically to see whether URLs are correct now.
|
|
190
191
|
download_urls=[f['links']['self'].replace('/api/', '/') for f in d.get('files')],
|
|
192
|
+
metadata=d['metadata']
|
|
191
193
|
)
|
|
192
194
|
if 'license' in d['metadata']:
|
|
193
195
|
lic = d['metadata']['license']
|
|
@@ -245,23 +247,28 @@ class Record:
|
|
|
245
247
|
if (condition is None) or condition(ds):
|
|
246
248
|
return Dataset.from_metadata(ds.copy(dest, mdname=mdname))
|
|
247
249
|
|
|
248
|
-
|
|
249
|
-
def bibtex(self) -> str:
|
|
250
|
+
def get_bibtex(self, bibid=None) -> str:
|
|
250
251
|
src = Source(
|
|
251
252
|
'misc',
|
|
252
|
-
self.doi.split('/')[-1].replace('.', '-'),
|
|
253
|
+
bibid or self.doi.split('/')[-1].replace('.', '-'),
|
|
253
254
|
author=' and '.join(self.creators),
|
|
254
255
|
title=self.title,
|
|
255
256
|
keywords=', '.join(self.keywords),
|
|
256
257
|
publisher='Zenodo',
|
|
257
258
|
year=self.year,
|
|
259
|
+
edition=self.version,
|
|
258
260
|
doi=self.doi,
|
|
261
|
+
type='Data set',
|
|
259
262
|
url='https://doi.org/{}'.format(self.doi),
|
|
260
263
|
)
|
|
261
264
|
if self.license:
|
|
262
265
|
src['copyright'] = self.license
|
|
263
266
|
return src.bibtex()
|
|
264
267
|
|
|
268
|
+
@property
|
|
269
|
+
def bibtex(self) -> str:
|
|
270
|
+
return self.get_bibtex()
|
|
271
|
+
|
|
265
272
|
def get_citation(self, api) -> str:
|
|
266
273
|
# curl -H "Accept:text/x-bibliography" "https://zenodo.org/api/records/7079637?style=apa
|
|
267
274
|
return api.records(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cldfzenodo
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Functionality to retrieve CLDF datasets deposited on Zenodo
|
|
5
5
|
Home-page: https://github.com/cldf/cldfzenodo
|
|
6
6
|
Author: Robert Forkel
|
|
@@ -26,10 +26,24 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
|
26
26
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
27
27
|
Requires-Python: >=3.8
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: clldutils
|
|
31
|
+
Requires-Dist: pycldf>=1.30.0
|
|
32
|
+
Requires-Dist: nameparser
|
|
33
|
+
Requires-Dist: attrs
|
|
29
34
|
Provides-Extra: cli
|
|
35
|
+
Requires-Dist: cldfbench; extra == "cli"
|
|
30
36
|
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: flake8; extra == "dev"
|
|
38
|
+
Requires-Dist: wheel; extra == "dev"
|
|
39
|
+
Requires-Dist: build; extra == "dev"
|
|
40
|
+
Requires-Dist: twine; extra == "dev"
|
|
31
41
|
Provides-Extra: test
|
|
32
|
-
|
|
42
|
+
Requires-Dist: cldfbench; extra == "test"
|
|
43
|
+
Requires-Dist: pytest>=5; extra == "test"
|
|
44
|
+
Requires-Dist: pytest-mock; extra == "test"
|
|
45
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
46
|
+
Requires-Dist: coverage>=4.2; extra == "test"
|
|
33
47
|
|
|
34
48
|
# cldfzenodo
|
|
35
49
|
|
|
@@ -167,5 +181,3 @@ via
|
|
|
167
181
|
```python
|
|
168
182
|
cldf = API.get_record(doi='...').download_dataset('my_directory')
|
|
169
183
|
```
|
|
170
|
-
|
|
171
|
-
|
|
@@ -58,6 +58,7 @@ def test_Record(record):
|
|
|
58
58
|
assert record.version == 'v1.1'
|
|
59
59
|
assert record.concept_doi == '10.5281/zenodo.4691101'
|
|
60
60
|
assert 'Greenhill, Simon J. and Haynie, Hannah J.' in record.bibtex
|
|
61
|
+
assert record.metadata['resource_type']['type'] == 'dataset'
|
|
61
62
|
|
|
62
63
|
rec = Record(doi='https://doi.org/10.5281/zenodo.4691101', title='', closed_access=True)
|
|
63
64
|
assert rec.id == '4691101'
|
|
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
|
|
File without changes
|
|
File without changes
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
attrs
|
|
2
1
|
clldutils
|
|
3
|
-
nameparser
|
|
4
2
|
pycldf>=1.30.0
|
|
3
|
+
nameparser
|
|
4
|
+
attrs
|
|
5
5
|
|
|
6
6
|
[cli]
|
|
7
7
|
cldfbench
|
|
8
8
|
|
|
9
9
|
[dev]
|
|
10
|
-
build
|
|
11
10
|
flake8
|
|
12
|
-
twine
|
|
13
11
|
wheel
|
|
12
|
+
build
|
|
13
|
+
twine
|
|
14
14
|
|
|
15
15
|
[test]
|
|
16
16
|
cldfbench
|
|
17
|
-
coverage>=4.2
|
|
18
|
-
pytest-cov
|
|
19
|
-
pytest-mock
|
|
20
17
|
pytest>=5
|
|
18
|
+
pytest-mock
|
|
19
|
+
pytest-cov
|
|
20
|
+
coverage>=4.2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|