From 901c0e1cfb23d84338f4522255ff3b20b1cb9a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20V=C3=B6lgyes?= Date: Wed, 6 Jun 2018 15:20:34 +0200 Subject: [PATCH] documentation and CI update --- .gitlab-ci.yml | 12 ++++++++++++ README.md | 18 +++++++++++++++++- src/zenodo_get.py | 33 +++++++++++++++++++++++++++++++-- 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..3a8e6bd --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,12 @@ +image: python:3.5 + +variables: + PYVERSION: 3 + +test: + script: + - apt-get update -qy + - pip3 --version + - pip3 install -r requirements.txt + - pip3 install coverage + - make test diff --git a/README.md b/README.md index 2488309..fd92141 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Travis CI: [![Build Status](https://travis-ci.org/dvolgyes/zenodo_get.svg?branch Semaphore: [![Build Status](https://semaphoreci.com/api/v1/dvolgyes/zenodo_get/branches/master/badge.svg)](https://semaphoreci.com/dvolgyes/zenodo_get) CircleCI: [![Build status](https://circleci.com/gh/dvolgyes/zenodo_get.svg?style=svg)](https://circleci.com/gh/dvolgyes/zenodo_get) AppVeyor: [![Build status](https://ci.appveyor.com/api/projects/status/f6hw96rhdl104ch9?svg=true)](https://ci.appveyor.com/project/dvolgyes/zenodo-get) +Gitlab CI: [![gitlabci](https://gitlab.com/dvolgyes/zenodo_get/badges/master/build.svg)](https://gitlab.com/dvolgyes/zenodo_get/pipelines) Coveralls: [![Coverage Status](https://coveralls.io/repos/github/dvolgyes/zenodo_get/badge.svg?branch=master)](https://coveralls.io/github/dvolgyes/zenodo_get?branch=master) Codecov: [![codecov](https://codecov.io/gh/dvolgyes/zenodo_get/branch/master/graph/badge.svg)](https://codecov.io/gh/dvolgyes/zenodo_get) @@ -14,13 +15,28 @@ This is a Python2/3 tool which can mass-download files from Zenodo records. ![PyPI - License](https://img.shields.io/pypi/l/zenodo_get.svg) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1261812.svg)](https://doi.org/10.5281/zenodo.1261812) +Source code +----------- + +The code is hosted at Github and GitLab too, with the exact same content. +However, on long term, the project will migrate to GitLab, so please, use the GitLab site: +[https://gitlab.com/dvolgyes/zenodo_get](https://gitlab.com/dvolgyes/zenodo_get) + + Install ------- +From PyPI: ``` -pip3 install git+https://github.com/dvolgyes/zenodo_get +pip3 install zenodo_get ``` +Or from Gitlab: +``` +pip3 install git+https://gitlab.com/dvolgyes/zenodo_get +``` + + Afterwards, you can query the command line options: ``` zenodo_get.py -h diff --git a/src/zenodo_get.py b/src/zenodo_get.py index 7c8c2bf..2356b0f 100755 --- a/src/zenodo_get.py +++ b/src/zenodo_get.py @@ -14,13 +14,27 @@ __version__ = '1.0.0' __title__ = 'zenodo_get' __summary__ = 'Zenodo record downloader.' -__uri__ = 'https://github.com/dvolgyes/zenodo_get' +__uri__ = 'https://gitlab.com/dvolgyes/zenodo_get' __license__ = 'AGPL v3' __author__ = 'David Völgyes' __email__ = 'david.volgyes@ieee.org' +__doi__ = '10.5281/zenodo.1261812' __description__ = """ -This program is meant to download a Zenodo record using DOI or record ID. +This program is meant to download complete Zenodo records based +on the Zenodo record ID or the DOI. The primary goal is to easy access +to large records with dozens of files. """ +__bibtex__ = """@misc{david_volgyes_2018_1261812, + author = {David Völgyes}, + title = {Zenodo_get: a downloader for Zenodo records.}, + month = june, + year = 2018, + doi = {%s}, + url = {https://doi.org/%s} +}""" % (__doi__, __doi__) +__reference__ = """David Völgyes. (2018, June 4). \ +Zenodo_get: a downloader for Zenodo records (Version %s). +Zenodo. https://doi.org/%s""" % (__version__, __doi__) def eprint(*args, **kwargs): @@ -48,6 +62,13 @@ def check_hash(filename, checksum): usage='%prog [options] RECORD_OR_DOI', version='%prog {}'.format(__version__) ) + + parser.add_option('-c', '--cite', + dest='cite', + action='store_true', + default=False, + help='print citation information') + parser.add_option('-r', '--record', action='store', type='string', @@ -113,6 +134,14 @@ def check_hash(filename, checksum): (options, args) = parser.parse_args() + if options.cite: + print('Reference for this software:') + print(__reference__) + print() + print('Bibtex format:') + print(__bibtex__) + sys.exit(0) + if len(args) > 0: try: t = int(args[0])