ORCID service client
Project description
[![Build Status](https://travis-ci.org/puntonim/inspire-service-orcid.svg?branch=master)](https://travis-ci.org/puntonim/inspire-service-orcid)
# Inspire ORCID service client
This package is service client for ORCID API used in inspire-next.
## Client usage
```python
# Configure settings.
import inspire_services.orcid.conf
d = dict(
DO_USE_SANDBOX=False,
CONSUMER_KEY='myorcidappkey',
CONSUMER_SECRET='myorcidappsecret',
REQUEST_TIMEOUT=30,
)
inspire_services.orcid.conf.settings.configure(**d)
# Use the client.
from inspire_services.orcid.client import OrcidClient
client = OrcidClient('mytoken', '0000-0002-0942-3697')
response = client.get_all_works_summary()
response.raise_for_result()
putcode = response['group'][0]['work-summary'][0]['put-code']
```
## Development
```bash
# Create a venv and install the requirements:
$ make venv
# Run isort and lint:
$ make isort
$ make lint
# Run all the tests:
$ make test # tox against Python27 and Python36.
$ tox -e py27 # tox against a specific Python version.
$ pytest # pytest against the active venv.
# Run a specific test:
$ make test/tests/test_orcid.py # tox against Python27 and Python36.
$ tox -e py27 -- tests/test_orcid.py # tox against a specific Python version.
$ pytest tests/test_orcid.py # pytest against the active venv.
```
To publish on PyPi:
```bash
# Edit .pypirc:
$ cat $HOME/.pypirc
[pypi]
username: myuser
password: mypass
# Edit the version in `setup_gen.py`.
# Finally compile and publish:
$ make publish
```
# Inspire ORCID service client
This package is service client for ORCID API used in inspire-next.
## Client usage
```python
# Configure settings.
import inspire_services.orcid.conf
d = dict(
DO_USE_SANDBOX=False,
CONSUMER_KEY='myorcidappkey',
CONSUMER_SECRET='myorcidappsecret',
REQUEST_TIMEOUT=30,
)
inspire_services.orcid.conf.settings.configure(**d)
# Use the client.
from inspire_services.orcid.client import OrcidClient
client = OrcidClient('mytoken', '0000-0002-0942-3697')
response = client.get_all_works_summary()
response.raise_for_result()
putcode = response['group'][0]['work-summary'][0]['put-code']
```
## Development
```bash
# Create a venv and install the requirements:
$ make venv
# Run isort and lint:
$ make isort
$ make lint
# Run all the tests:
$ make test # tox against Python27 and Python36.
$ tox -e py27 # tox against a specific Python version.
$ pytest # pytest against the active venv.
# Run a specific test:
$ make test/tests/test_orcid.py # tox against Python27 and Python36.
$ tox -e py27 -- tests/test_orcid.py # tox against a specific Python version.
$ pytest tests/test_orcid.py # pytest against the active venv.
```
To publish on PyPi:
```bash
# Edit .pypirc:
$ cat $HOME/.pypirc
[pypi]
username: myuser
password: mypass
# Edit the version in `setup_gen.py`.
# Finally compile and publish:
$ make publish
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for inspire-service-orcid-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2e133f7ca3e63aaeea1863220e3f994586aad0e7c6101184ed682529fdb8a2c |
|
MD5 | 7931754cb2e47fab950576854f801522 |
|
BLAKE2b-256 | e61a00a577c389e147a3e24fcc5e84f5bc74c936fe97455f1b1ae74a63669e97 |