|
1 | | -[](https://travis-ci.com/AUSSDA/pyDataverse) [](https://coveralls.io/github/AUSSDA/pyDataverse?branch=master) |
| 1 | +[](https://travis-ci.com/AUSSDA/pyDataverse) [](https://coveralls.io/github/AUSSDA/pyDataverse) [](https://pydataverse.readthedocs.io/en/latest) [](https://opensource.org/licenses/MIT) |
2 | 2 |
|
3 | 3 | # pyDataverse |
4 | 4 |
|
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. |
7 | 6 |
|
8 | 7 | **Features** |
9 | 8 |
|
| 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/) |
10 | 15 | * 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 | | - |
18 | 16 |
|
19 | 17 | **Copyright** |
20 | 18 |
|
21 | | -* Code: [](https://opensource.org/licenses/MIT) |
| 19 | +* Sourcecode: [](https://opensource.org/licenses/MIT) |
22 | 20 | * Documentation: [](https://creativecommons.org/licenses/by/4.0/) |
23 | 21 |
|
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 | | - |
38 | 22 | ## QUICKSTART |
39 | 23 |
|
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). |
123 | 25 |
|
124 | 26 | ## CONTRIBUTE |
125 | 27 |
|
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). |
0 commit comments