Rich Context API integrations for federating discovery services and metadata exchange across multiple scholarly infrastructure providers
Rich Context API integrations for federating discovery services and metadata 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 journal references
- reconcile author profiles
- reconcile keyword taxonomy
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.
- Python 3.x
- Beautiful Soup
- Crossref Commons
- Dimensions CLI
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
and populate it with your credentials.
NB: be careful not to commit the
rc.cfg file in Git since by
definition it will contain sensitive data, e.g., your passwords.
Parameters used in the configuration file include:
||CORE API key|
||Dimensions API password|
||Elsvier API key|
|personal email address|
||ORCID API key|
||RePEc API token|
webdriver for the
Chrome brower to enable use of Selenium.
This will be run in a "headless" mode.
For a good (though slightly dated) tutorial for installing and testing Selenium on Ubuntu Linux, see: https://christopher.su/2015/selenium-chromedriver-ubuntu/
from richcontext import scholapi as rc_scholapi # initialize the federated API access schol = rc_scholapi.ScholInfraAPI(config_file="rc.cfg", logger=None) source = schol.openaire # 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... if source.has_credentials(): response = source.title_search(title) # report results if response.message: # error case print(response.message) else: print(response.meta) source.report_perf(response.timing)
First, be sure that you're testing the source and not from an installed library.
Then run unit tests on the APIs for which you have credentials and generate a coverage report:
coverage run -m unittest discover
Then create GitHub issues among the submodules for any failed tests.
Also, you can generate a coverage report and upload that via:
coverage report bash <(curl -s https://codecov.io/bash) -t @.cc_token
Test coverage reports can be viewed at https://codecov.io/gh/Coleridge-Initiative/RCApi
APIs used to retrieve metadata:
See the coding examples in the
test.py unit test for usage patterns
per supported API.
If you encounter an exception about the
ChromeDriver version, for
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 78
Then check your instance of the Chrome browser to find its release
number, then go to https://chromedriver.chromium.org/downloads to
download the corresponding required version of
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
If you'd like to contribute, please see our listings of good first issues.
For info about joining the AI team working on Rich Context, see https://github.com/Coleridge-Initiative/RCGraph/blob/master/SKILLS.md
Contributors: @ceteri, @IanMulvany, @srand525, @ernestogimeno, @lobodemonte, plus many thanks for the inspiring 2019 Rich Context Workshop notes by @metasj, and guidance from @claytonrsh, @Juliaingridlane.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size richcontext_scholapi-1.2.0-py3-none-any.whl (14.8 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size richcontext-scholapi-1.2.0.tar.gz (19.3 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for richcontext_scholapi-1.2.0-py3-none-any.whl
Hashes for richcontext-scholapi-1.2.0.tar.gz