You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+62-4Lines changed: 62 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,65 @@
1
-
This is a library for writing Python applications that make use of Dataverse Network (DVN) APIs.
1
+
## Dataverse Network (DVN) API Client
2
2
3
-
The code was originally written as a "proof of concept" at https://github.com/dvn/swordpoc/tree/master/dvn_client but the intention is to eventually publish the code on https://pypi.python.org so users can run `pip install dvn-client` to use the Python library.
3
+
This is a library for writing Python applications that make use of Dataverse
4
+
Network (DVN) APIs. The code started as a "proof of concept" in the
5
+
[dvn/swordpoc](https://github.com/dvn/swordpoc) repo and the intent is to
6
+
publish the python client on https://pypi.python.org.
4
7
5
-
For now https://github.com/dvn/swordpoc/blob/master/dvn_client/README.md has some tips but they should be incorporated into this repo.
You may wish to manage virtualenvs using [virtualenvwrapper](http://virtualenvwrapper.readthedocs.org/en/latest/) instead.
36
+
37
+
## Configuration
38
+
39
+
Make a `config_local.py` file and fill out the config elements as appropriate. Do not commit this file.
40
+
41
+
```python
42
+
DEFAULT_USERNAME=""
43
+
DEFAULT_PASSWORD=""
44
+
DEFAULT_HOST="dvn-4.hmdc.harvard.ed"
45
+
DEFAULT_CERT="../resources/dvn-4.hmdc.harvard.edu"#see below for info on the cert
46
+
```
47
+
48
+
## Installation Test
49
+
50
+
* Navigate to `dvn-client-python/dvn-client/src/`
51
+
* Edit test data in `tests.py` as appropriate
52
+
* Run the client `python dvn_client.py`
53
+
* To run all of the tests, run `python dvn_test.py` (for more options see [unittest](http://docs.python.org/2/library/unittest.html#assert-methods))
54
+
55
+
## PEM Certificate (optional)
56
+
57
+
If you are using a self-signed certificate, you may see an SSL error when you
58
+
try to hit the server. In that case, follow these instructions.
59
+
60
+
1. Open private/incognito window (in case you have already added a security exception) in FireFox (instructions will be slightly different for other browsers)
61
+
2. Go to: https://{SERVER}/dvn/api/data-deposit/swordv2/service-document
62
+
3. Add Exception > View > Details > Export
63
+
4. Save the PEM to the “resources” folder of the dvn\_client project
64
+
5. When calling `Dataverse.connect()` or `Dataverse()` constructor, pass a path to this file as `cert=[PATH_TO_CERTIFICATE]`
6
65
7
-
We have been trying to target Python 2.6 because that's the version that ships with the latest version (6) of Red Hat Enterprise Linux (RHEL) and CentOS. For testing backward compatibility with Python 2.6, this repo includes a Vagrant environment. Please note that before you run `vagrant up` you'll need to run `git submodule init` and `git submodule update` once after cloning this repo.
0 commit comments