zenodoclient


Namezenodoclient JSON
Version 0.5.1 PyPI version JSON
download
home_pagehttps://github.com/dlce-eva/zenodoclient
Summaryprogrammatic access to Zenodo
upload_time2023-06-23 14:36:11
maintainer
docs_urlNone
authorRobert Forkel
requires_python>=3.7
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # zenodoclient

[![Build Status](https://github.com/dlce-eva/zenodoclient/workflows/tests/badge.svg)](https://github.com/dlce-eva/zenodoclient/actions?query=workflow%3Atests)
[![PyPI](https://img.shields.io/pypi/v/zenodoclient.svg)](https://pypi.org/project/zenodoclient)

Python package to access the Zenodo API ([REST](http://developers.zenodo.org/) and
[OAI-PMH](http://developers.zenodo.org/#oai-pmh)) programmatically and from the command line.


# Install

To install from pypi
```shell
pip install zenodoclient
```

Instructions for a development installation can be found in 
[`CONTRIBUTING.md`](CONTRIBUTING.md).


# Curating deposits

To curate deposits on Zenodo, you need an [access token](https://zenodo.org/account/settings/applications/tokens/new/).
Then you can use the CLI:
```
zenodo --access-token $YOURTOKEN ls
```


# Accessing OAI-PMH feeds

Zenodo disseminates the metadata for communities via OAI-PMH. This metadata
can be accessed programmatically from python as folows:
```python
>>> from zenodoclient.oai import Records
>>> recs = Records('dictionaria')
>>> len(recs)
18
```
We can list the latest version for each Dictionaria dictionary:
```python
>>> import itertools
>>> for d, records in itertools.groupby(sorted(recs, key=lambda r: (r.repos.repos, r.version), reverse=True), lambda r: r.repos.repos):
...     print(d, next(records).tag)
...     
wersing v1.0
tseltal v1.0.1
teop v1.0
sidaama v1.0
sanzhi v1.0
palula v1.0
nen v1.1
medialengua v1.0
kalamang v1.0
hdi v1.1
guarayu v1.0
diidxaza v1.0
daakaka v1.1.1
```
and look at metadata:
```python
>>> recs[0].doi
'10.5281/zenodo.3066952'
>>> recs[0].citation
'Henrik Liljegren. (2019). dictionaria/palula: Palula Dictionary (Version v1.0) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.3066952'
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dlce-eva/zenodoclient",
    "name": "zenodoclient",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Robert Forkel",
    "author_email": "robert_forkel@eva.mpg.de",
    "download_url": "https://files.pythonhosted.org/packages/ac/3a/296b70bc30d096c6e2003771d62c516e5231b57a0aaa12b1ad06c21e898c/zenodoclient-0.5.1.tar.gz",
    "platform": "any",
    "description": "# zenodoclient\n\n[![Build Status](https://github.com/dlce-eva/zenodoclient/workflows/tests/badge.svg)](https://github.com/dlce-eva/zenodoclient/actions?query=workflow%3Atests)\n[![PyPI](https://img.shields.io/pypi/v/zenodoclient.svg)](https://pypi.org/project/zenodoclient)\n\nPython package to access the Zenodo API ([REST](http://developers.zenodo.org/) and\n[OAI-PMH](http://developers.zenodo.org/#oai-pmh)) programmatically and from the command line.\n\n\n# Install\n\nTo install from pypi\n```shell\npip install zenodoclient\n```\n\nInstructions for a development installation can be found in \n[`CONTRIBUTING.md`](CONTRIBUTING.md).\n\n\n# Curating deposits\n\nTo curate deposits on Zenodo, you need an [access token](https://zenodo.org/account/settings/applications/tokens/new/).\nThen you can use the CLI:\n```\nzenodo --access-token $YOURTOKEN ls\n```\n\n\n# Accessing OAI-PMH feeds\n\nZenodo disseminates the metadata for communities via OAI-PMH. This metadata\ncan be accessed programmatically from python as folows:\n```python\n>>> from zenodoclient.oai import Records\n>>> recs = Records('dictionaria')\n>>> len(recs)\n18\n```\nWe can list the latest version for each Dictionaria dictionary:\n```python\n>>> import itertools\n>>> for d, records in itertools.groupby(sorted(recs, key=lambda r: (r.repos.repos, r.version), reverse=True), lambda r: r.repos.repos):\n...     print(d, next(records).tag)\n...     \nwersing v1.0\ntseltal v1.0.1\nteop v1.0\nsidaama v1.0\nsanzhi v1.0\npalula v1.0\nnen v1.1\nmedialengua v1.0\nkalamang v1.0\nhdi v1.1\nguarayu v1.0\ndiidxaza v1.0\ndaakaka v1.1.1\n```\nand look at metadata:\n```python\n>>> recs[0].doi\n'10.5281/zenodo.3066952'\n>>> recs[0].citation\n'Henrik Liljegren. (2019). dictionaria/palula: Palula Dictionary (Version v1.0) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.3066952'\n```\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "programmatic access to Zenodo",
    "version": "0.5.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/dlce-eva/zenodoclient/issues",
        "Homepage": "https://github.com/dlce-eva/zenodoclient"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "830bb37d17e01a5f8c9c4c30fecb558ea206dd50d4b9e08ac8c1ffd4fd4fa676",
                "md5": "0cc10de48ac0a2501b6ce5420befe2a0",
                "sha256": "d26e137c9f4b56c7c5a539e71fc6554738ca2c5ef6a863d89ef77a54e98f4387"
            },
            "downloads": -1,
            "filename": "zenodoclient-0.5.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0cc10de48ac0a2501b6ce5420befe2a0",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.7",
            "size": 17550,
            "upload_time": "2023-06-23T14:36:08",
            "upload_time_iso_8601": "2023-06-23T14:36:08.995864Z",
            "url": "https://files.pythonhosted.org/packages/83/0b/b37d17e01a5f8c9c4c30fecb558ea206dd50d4b9e08ac8c1ffd4fd4fa676/zenodoclient-0.5.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ac3a296b70bc30d096c6e2003771d62c516e5231b57a0aaa12b1ad06c21e898c",
                "md5": "0e3e668995071ccc94381ad5b4af3c8a",
                "sha256": "d1a0bfa53af792eb8de73a89cb6315d8b3ed967230398872c5841173c8d17bab"
            },
            "downloads": -1,
            "filename": "zenodoclient-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0e3e668995071ccc94381ad5b4af3c8a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 18960,
            "upload_time": "2023-06-23T14:36:11",
            "upload_time_iso_8601": "2023-06-23T14:36:11.501213Z",
            "url": "https://files.pythonhosted.org/packages/ac/3a/296b70bc30d096c6e2003771d62c516e5231b57a0aaa12b1ad06c21e898c/zenodoclient-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-23 14:36:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dlce-eva",
    "github_project": "zenodoclient",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "zenodoclient"
}
        
Elapsed time: 0.09316s