Skip to main content

Rich Context API integrations for federating metadata discovery and exchange across multiple scholarly infrastructure providers

Project description

richcontext.scholapi

Rich Context API integrations for federating metadata discovery and exchange across multiple scholarly infrastructure providers.

Development of the Rich Context knowledge graph uses this library to:

  • identify dataset links to research publications
  • locate open access publications
  • reconcile author profiles
  • reconcile keyword mesh

This library has been guided by collaborative work on community building and metadata exchange to improve Scholarly Infrastructure, held at the 2019 Rich Context Workshop.

Installation

Prerequisites:

To install from PyPi:

pip install richcontext.scholapi

If you install directly from this Git repo, be sure to install the dependencies as well:

pip install -r requirements.txt

Then copy the configuration file template rc_template.cfg to rc.cfg and populate it with your credentials.

NB: be careful not to commit the rc.cfg file in Git since it contains sensitive data such as passwords.

Parameters needed in the configuration file include:

parameter value
chrome_exe_path path/to/chrome.exe
dimensions_password Dimensions API password
email personal email address
repec_token RePEc API token

Download the Chrome webdriver to enable use of Selenium.

Usage

from richcontext import scholapi as rc_scholapi
import pprint

# initialize the federated API access
schol = rc_scholapi.ScholInfraAPI(config_file="rc.cfg", logger=None)

# search parameters for example publications
title = "Deal or no deal? The prevalence and nutritional quality of price promotions among U.S. food and beverage purchases."

# run it...
meta = schol.openaire.title_search(title)

# report results
pprint.pprint(meta)
print("\ntime: {:.3f} ms - {}".format(schol.openaire.elapsed_time, schol.openaire.name))

API Integrations

APIs used to retrieve metadata:

See docs/enrich_pubs.ipynb for example API usage to pull the federated metadata for a publication.

For more background about open access publications see:

Piwowar H, Priem J, Larivière V, Alperin JP, Matthias L, Norlander B, Farley A, West J, Haustein S. 2017.
The State of OA: A large-scale analysis of the prevalence and impact of Open Access articles
PeerJ Preprints 5:e3119v1
https://doi.org/10.7287/peerj.preprints.3119v1

Testing

To run unit tests for the APIs which do not require credentials:

python test/test.py

To run unit tests for all of the APIs:

python test/full_test.py

To Do

Kudos

Contributors: @ceteri, @srand525, plus many thanks for the inspiring 2019 Rich Context Workshop notes by @metasj.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

richcontext-scholapi-1.0.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

richcontext_scholapi-1.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file richcontext-scholapi-1.0.0.tar.gz.

File metadata

  • Download URL: richcontext-scholapi-1.0.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.5

File hashes

Hashes for richcontext-scholapi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 944e8988f39fd244627b4f9aecb2451df61176fba2ad76a2a4510aebaff65293
MD5 0267e396c67b2b59582e9be83fecacc3
BLAKE2b-256 ec06e7cfec57fa3b5ed4e074660584b268b386abdbae8b7b9aed4807b8650d4d

See more details on using hashes here.

File details

Details for the file richcontext_scholapi-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: richcontext_scholapi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.5

File hashes

Hashes for richcontext_scholapi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb2a0d82892624477aebe1d17fc0644c2b158b51789a3ffcc580318610e3516d
MD5 d0ea1d8abc772418150e92ac07101a64
BLAKE2b-256 b8775f997a4406c0834974ba034a6ca3c5b8902b7b0c254beeea832c1f2717d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page