ORCID service client
Project description
[](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_service_orcid.conf
d = dict(
DO_USE_SANDBOX=False,
CONSUMER_KEY='myorcidappkey',
CONSUMER_SECRET='myorcidappsecret',
REQUEST_TIMEOUT=30,
)
inspire_service_orcid.conf.settings.configure(**d)
# Use the client.
from inspire_service_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_client.py # tox against Python27 and Python36.
$ tox -e py27 -- tests/test_client.py # tox against a specific Python version.
$ pytest tests/test_client.py # pytest against the active venv.
```
To publish on PyPi, first set the PyPi credentials:
```bash
# Edit .pypirc:
$ cat $HOME/.pypirc
[pypi]
username: myuser
password: mypass
```
```bash
# Edit the version in `setup_gen.py`.
# ... version=pep440_version('1.1.1'),
# Then generate setup.py with:
$ make setup.py
# Commit, tag, push:
$ git commit -m '1.1.1 release'
$ git tag 1.1.1
$ git push origin master --tags
# Finally 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_service_orcid.conf
d = dict(
DO_USE_SANDBOX=False,
CONSUMER_KEY='myorcidappkey',
CONSUMER_SECRET='myorcidappsecret',
REQUEST_TIMEOUT=30,
)
inspire_service_orcid.conf.settings.configure(**d)
# Use the client.
from inspire_service_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_client.py # tox against Python27 and Python36.
$ tox -e py27 -- tests/test_client.py # tox against a specific Python version.
$ pytest tests/test_client.py # pytest against the active venv.
```
To publish on PyPi, first set the PyPi credentials:
```bash
# Edit .pypirc:
$ cat $HOME/.pypirc
[pypi]
username: myuser
password: mypass
```
```bash
# Edit the version in `setup_gen.py`.
# ... version=pep440_version('1.1.1'),
# Then generate setup.py with:
$ make setup.py
# Commit, tag, push:
$ git commit -m '1.1.1 release'
$ git tag 1.1.1
$ git push origin master --tags
# Finally 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
File details
Details for the file inspire-service-orcid-3.2.0.tar.gz.
File metadata
- Download URL: inspire-service-orcid-3.2.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7824a28da0ad8cd62cae3ae3c51b3b580048c774c2446f276ea91c0108c619fa
|
|
| MD5 |
91057df9fc1b0f124137e1b482e8fcf4
|
|
| BLAKE2b-256 |
6e1cf3f4bb704564ceadeb86f2072dcdfcd105b801a46976a5a8405ecb7e981c
|