Skip to content

Commit

Permalink
documentation and CI update
Browse files Browse the repository at this point in the history
  • Loading branch information
dvolgyes committed Jun 6, 2018
1 parent 499aef0 commit 901c0e1
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
33 changes: 31 additions & 2 deletions src/zenodo_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit 901c0e1

Please sign in to comment.