Skip to content

Commit 2b1f2b8

Browse files
committed
Merge branch 'develop'
2 parents adc3374 + e5d391e commit 2b1f2b8

27 files changed

Lines changed: 525 additions & 267 deletions

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ venv_home/
1313
# Personal
1414
notes*.md
1515
stash*.*
16+
setup.sh
17+
.pypirc
1618

1719
# Distribution / packaging
1820
build/
@@ -23,13 +25,12 @@ dist/
2325
MANIFEST
2426

2527
# Documentation
26-
docs/build/
28+
/docs
2729
src/pyDataverse/docs/build
2830
src/pyDataverse/docs/Makefile
2931

3032
# Unit test / coverage reports
3133
.tox
32-
docs/coverage_html/
3334
.coverage
3435
.coverage.*
3536
.*cache

.readthedocs.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: src/pyDataverse/docs/source/conf.py
11+
12+
# Optionally build your docs in additional formats such as PDF and ePub
13+
formats: all
14+
15+
# Optionally set the version of Python and requirements required to build your docs
16+
python:
17+
version: 3.6
18+
install:
19+
- requirements: tools/docs-requirements.txt
20+
- requirements: requirements.txt
21+
- method: pip
22+
path: .
23+
system_packages: true

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ matrix:
2626
branches:
2727
only:
2828
- master
29+
- develop
2930

3031
before_install:
3132
- echo $TRAVIS_PYTHON_VERSION
@@ -39,10 +40,8 @@ install:
3940
- pip --version
4041
- tox --version
4142

42-
4343
script:
4444
- tox
45-
- pytest tests/ --cov=pyDataverse --cov-report=term-missing --cov-report=xml --cov-report=html
4645

4746
after_success:
4847
- coveralls

HISTORY.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. :changelog:
2+
3+
0.1.0 - Marietta Blau (2019-05-20)
4+
------------------------------------
5+
6+
- First release on PyPI.

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,28 @@
1-
[![Build Status](https://travis-ci.com/AUSSDA/pyDataverse.svg?branch=master)](https://travis-ci.com/AUSSDA/pyDataverse) [![Coverage Status](https://coveralls.io/repos/github/AUSSDA/pyDataverse/badge.svg?branch=master)](https://coveralls.io/github/AUSSDA/pyDataverse?branch=master)
1+
[![Build Status](https://travis-ci.com/AUSSDA/pyDataverse.svg?branch=master)](https://travis-ci.com/AUSSDA/pyDataverse) [![Coverage Status](https://coveralls.io/repos/github/AUSSDA/pyDataverse/badge.svg)](https://coveralls.io/github/AUSSDA/pyDataverse) [![Documentation Status](https://readthedocs.org/projects/pydataverse/badge/?version=latest)](https://pydataverse.readthedocs.io/en/latest) [![GitHub](https://img.shields.io/github/license/aussda/pydataverse.svg)](https://opensource.org/licenses/MIT)
22

33
# pyDataverse
44

5-
A Python module to work with the Dataverse API. It allows to create, update and remove Dataverses, Datasets and Datafiles via Dataverse's native API. Thanks to the developers of [dataverse-client-python](https://github.com/IQSS/dataverse-client-python), from which the project got inspired from.
6-
5+
pyDataverse is a Python module for [Dataverse](http://dataverse.org/). It uses the [Native API](http://guides.dataverse.org/en/latest/api/native-api.html) and [Data Access API](http://guides.dataverse.org/en/latest/api/dataaccess.html). It allows to create, update and remove Dataverses, Datasets and Datafiles via Dataverse's native API. Thanks to the developers of [dataverse-client-python](https://github.com/IQSS/dataverse-client-python), from which the project got inspired from.
76

87
**Features**
98

9+
* Open Source ([MIT](https://opensource.org/licenses/MIT))
10+
* `api.py`: Dataverse Api functionalities to create, get, publish and delete Dataverses, Datasets and Datafiles.
11+
* `utils.py`: Functions to support the core functionalities.
12+
* `exceptions.py`: Custom exceptions
13+
* `tests/*`: Tests on [Travis CI](https://travis-ci.com/AUSSDA/pyDataverse) ([pytest](https://docs.pytest.org/en/latest/) + [tox](http://tox.readthedocs.io/)).
14+
* [Documentation](https://pydataverse.readthedocs.io/en/latest/)
1015
* Python 2 and 3 (>=2.7)
11-
* Open Source (MIT)
12-
* Many different Dataverse Api Requests (use GET, POST (Curl) and DELETE)
13-
* Utils functions to support the core-functions
14-
* Tests with [pytest](https://docs.pytest.org/en/latest/), [Travis CI](https://travis-ci.com/AUSSDA/pyDataverse) and [tox](http://tox.readthedocs.io/).
15-
* Documentation with [sphinx](http://www.sphinx-doc.org/).
16-
* Custom exceptions
17-
1816

1917
**Copyright**
2018

21-
* Code: [![GitHub](https://img.shields.io/github/license/aussda/pydataverse.svg)](https://opensource.org/licenses/MIT)
19+
* Sourcecode: [![GitHub](https://img.shields.io/github/license/aussda/pydataverse.svg)](https://opensource.org/licenses/MIT)
2220
* Documentation: [![License: CC BY 4.0](https://licensebuttons.net/l/by/4.0/80x15.png)](https://creativecommons.org/licenses/by/4.0/)
2321

24-
## INSTALL
25-
26-
**Requirements**
27-
28-
* curl
29-
30-
**Install**
31-
32-
```shell
33-
virtualenv --python=/usr/bin/python3 venv
34-
source venv/bin/activate
35-
pip install -r requirements.txt
36-
```
37-
3822
## QUICKSTART
3923

40-
**Connect to API**
41-
42-
```python
43-
from pyDataverse.api import Api
44-
base_url = 'http://demo.dataverse.org'
45-
api = Api(base_url)
46-
```
47-
**Get dataverse**
48-
49-
```python
50-
dv = 'ecastro' # dataverse alias or id
51-
resp = api.get_dataverse(dv)
52-
print(resp.json())
53-
```
54-
55-
**Get dataset**
56-
57-
```python
58-
identifier = 'doi:10.5072/FK2/U6AEZM' # doi of the dataset
59-
resp = api.get_dataset(identifier)
60-
```
61-
62-
**Get datafile**
63-
64-
```python
65-
datafile_id = '32' # file id of the datafile
66-
resp = api.get_datafile(datafile_id)
67-
print(resp.content)
68-
```
69-
70-
## DEVELOPMENT
71-
72-
### Install
73-
74-
```bash
75-
virtualenv --python=/usr/bin/python3 venv
76-
source venv/bin/activate
77-
pip install -r requirements.txt
78-
```
79-
80-
### Testing
81-
82-
[Tox](http://tox.readthedocs.io/) together with [pytest](https://docs.pytest.org/en/latest/) is used für testing.
83-
84-
First, you need to set the needed ENV variables. You can create a pytest.ini file with the ENV variables in it:
85-
86-
Example:
87-
```ini
88-
[pytest]
89-
env =
90-
API_TOKEN=<SECRET>
91-
DATAVERSE_VERSION=4.8.4
92-
BASE_URL=https://data.aussda.at
93-
```
94-
95-
or define it in the shell.
96-
97-
Example:
98-
```shell
99-
export API_TOKEN=<SECRET>
100-
export DATAVERSE_VERSION=4.8.4
101-
export BASE_URL=https://data.aussda.at
102-
```
103-
104-
To run through all tests (e. g. different python versions, packaging, docs, flake8, etc.), simply call tox from the root directory:
105-
```shell
106-
tox
107-
```
108-
109-
When you only want to run the py36 test:
110-
```shell
111-
tox -e py36
112-
```
113-
114-
### Documentation
115-
116-
Use Sphinx to create class and function documentation out of the doc-strings.
117-
118-
```
119-
sphinx-build -b html docs/source docs/build/html
120-
sphinx-apidoc -f -o docs/source ..
121-
make html
122-
```
24+
[See more](https://pydataverse.readthedocs.io/en/latest/index.html#quickstart).
12325

12426
## CONTRIBUTE
12527

126-
In the spirit of free software, everyone is encouraged to help improve this project.
127-
128-
Here are some ways you can contribute:
129-
130-
- by reporting bugs
131-
- by suggesting new features
132-
- by translating to a new language
133-
- by writing or editing documentation
134-
- by writing code (**no pull request is too small**: fix typos in the user interface, add code comments, clean up inconsistent whitespace)
135-
- by refactoring code or adding new features (please get in touch with us before you do, so we can syncronize the efforts and prevent misunderstandings)
136-
- by [closing issues](https://github.com/AUSSDA/pyDataverse/issues)
137-
- by [reviewing pull requests](https://github.com/AUSSDA/pyDataverse/pulls)
138-
139-
When you are ready, submit a [pull request](https://github.com/AUSSDA/pyDataverse).
140-
141-
### Submitting an Issue
142-
143-
We use the [GitHub issue tracker](https://github.com/AUSSDA/pyDataverse/issues) to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted. When submitting a bug report, please try to provide a screenshot that demonstrates the problem.
28+
[See more](https://pydataverse.readthedocs.io/en/latest/index.html#contributor-guide).

README.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

code-of-conduct.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project lead at stefan.kasberger@univie.ac.at. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq
77+

requirements.txt

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,22 @@
1-
alabaster==0.7.12
2-
atomicwrites==1.3.0
3-
attrs==18.2.0
4-
Babel==2.6.0
51
bleach==3.1.0
6-
certifi==2018.11.29
7-
chardet==3.0.3
8-
check-manifest==0.37
9-
coverage==4.5.2
2+
certifi==2019.3.9
3+
chardet==3.0.4
104
docutils==0.14
11-
entrypoints==0.3
125
filelock==3.0.10
13-
flake8==3.7.6
146
idna==2.8
15-
imagesize==1.1.0
16-
Jinja2==2.10.1
17-
MarkupSafe==1.1.0
18-
mccabe==0.6.1
19-
more-itertools==6.0.0
20-
packaging==19.0
21-
pathlib2==2.3.3
227
pkginfo==1.5.0.1
23-
pluggy==0.8.1
8+
pluggy==0.11.0
249
py==1.8.0
25-
pycodestyle==2.5.0
26-
pyflakes==2.1.0
27-
Pygments==2.3.1
28-
pyparsing==2.3.1
29-
pytest==4.3.0
30-
pytest-cov==2.6.1
31-
pytz==2018.9
10+
Pygments==2.4.0
3211
readme-renderer==24.0
3312
requests==2.21.0
3413
requests-toolbelt==0.9.1
3514
six==1.12.0
36-
snowballstemmer==1.2.1
37-
Sphinx==1.8.4
38-
sphinxcontrib-websupport==1.1.0
3915
toml==0.10.0
40-
tox==3.7.0
41-
tqdm==4.31.1
16+
tox==3.11.0
17+
tox-pytest-summary==0.1.2
18+
tqdm==4.32.1
4219
twine==1.13.0
43-
urllib3==1.24.2
44-
virtualenv==16.4.3
20+
urllib3==1.24.3
21+
virtualenv==16.6.0
4522
webencodings==0.5.1

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def run_tests(self):
6565
# 3 - Alpha
6666
# 4 - Beta
6767
# 5 - Production/Stable
68-
'Development Status :: 2 - Pre-Alpha',
68+
'Development Status :: 4 - Beta',
6969
'Intended Audience :: Developers',
7070
'Operating System :: OS Independent',
7171
'License :: OSI Approved :: MIT License',
@@ -101,6 +101,8 @@ def run_tests(self):
101101
keywords=['pydataverse', 'dataverse', 'api'],
102102
zip_safe=False,
103103
project_urls={
104-
'Issue Tracker': 'https://github.com/AUSSDA/pyDataverse/issues'
104+
'Documentation': 'https://pydataverse.readthedocs.io/',
105+
'Issue Tracker': 'https://github.com/AUSSDA/pyDataverse/issues',
106+
'Changelog': 'https://pydataverse.readthedocs.io/en/latest/community/releases.html'
105107
}
106108
)

0 commit comments

Comments
 (0)