Skip to content

Commit

Permalink
Merge pull request #7 from NYU-CI/paco_update
Browse files Browse the repository at this point in the history
prep release 1.0.0 on PyPi
  • Loading branch information
ceteri committed Nov 23, 2019
2 parents 0510ff4 + 0281511 commit 992a84c
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 30 deletions.
24 changes: 17 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# RichContext configuration -- do not commit these
rc.cfg
chromedriver
chromedriver.exe

.ipynb_checkpoints
# Python compiled modules
*.pyc
__pycache__

# Setuptools distribution folder
/dist/
/build/

# Python egg metadata, regenerated from source files by setuptools
/*.egg-info
/*.egg

# Jupyter notebooks
.ipynb_checkpoints/

# editor junk
.DS_Store
**~

dist
build
__pycache__
*.pyc
*.egg-info
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 The Coleridge Initiative @NYU

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include LICENSE
include README.md
include changelog.txt
include example.py
include rc_template.cfg
93 changes: 70 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
# RCApi
# richcontext.scholapi

API integrations for federating metadata lookup across multiple
scholarly infrastructure providers.
[Rich Context](https://coleridgeinitiative.org/richcontext)
API integrations for federating metadata discovery and exchange across
multiple scholarly infrastructure providers.

For the development of the Rich Context knowledge graph this library
is used to identify:
Development of the Rich Context knowledge graph uses this library to:

* dataset links to research
* locating open access publications
* reconciling author profiles
* reconciling keyword mesh
* 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

Copy the configuration file template `rc_template.cfg` to `rc.cfg`
then populate it with your credentials.
Prerequisites:

- [Python 3.x](https://www.python.org/downloads/)
- [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/)
- [Dimensions CLI](https://github.com/digital-science/dimcli)
- [Requests](https://2.python-requests.org/en/master/)
- [Selenium](https://github.com/SeleniumHQ/selenium/)

To install from [PyPi](https://pypi.python.org/pypi/richcontext.scholapi):

```
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.
Expand All @@ -33,6 +58,27 @@ Download the [Chrome webdriver](https://chromedriver.chromium.org/downloads)
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:
Expand Down Expand Up @@ -62,28 +108,29 @@ The State of OA: A large-scale analysis of the prevalence and impact of Open Acc
To run unit tests for the APIs which do not require credentials:

```
python test.py
python test/test.py
```

To run unit tests for all of the APIs:

```
python full_test.py
python test/full_test.py
```


## To Do


* Dimensions datasets
* Dimensions API for dataset metadata
* scrape metadata from web pages PMC/Pubmed, NIH, etc.
* SSRN
* Springer (https://github.com/srand525/search_springer/blob/master/SpringerFetch.py)
* https://paperswithcode.com/?ref=semscholar
=======
#### To Do
##### Add Apis:
* PMC/Pubmed
* RePEc
* Springer (https://github.com/srand525/search_springer/blob/master/SpringerFetch.py)
* https://paperswithcode.com/?ref=semscholar
* Springer <https://github.com/srand525/search_springer/blob/master/SpringerFetch.py>


## Kudos

Contributors:
[@ceteri](https://github.com/ceteri),
[@srand525](https://github.com/srand525),
plus many thanks for the inspiring *2019 Rich Context Workshop* notes by
[@metasj](https://github.com/metasj).
11 changes: 11 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `richcontext.scholapi` changelog

## 1.0.0

2019-11-23

### Initial

* first release on PyPi
* supports `title_search()` and `publication_lookup()` using several discovery APIs for Scholarly Infrastructure
* aligned with Community session goals from 2019 Rich Context Workshop (notes by Sameul Klein)
File renamed without changes.
40 changes: 40 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from setuptools import setup, find_namespace_packages

with open("README.md", "r") as fh:
long_description = fh.read()

setup(
name="richcontext-scholapi",
version="1.0.0",
author="Coleridge Initiative",
author_email="dataanalytics@coleridgeinitiative.org",
description="Rich Context API integrations for federating metadata discovery and exchange across multiple scholarly infrastructure providers",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/NYU-CI/RCApi",
packages=find_namespace_packages(include=['richcontext.*']),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
"Topic :: Scientific/Engineering :: Information Analysis",
],
python_requires=">=3.5",
install_requires=[
"beautifulsoup4",
"dimcli",
"requests",
"selenium",
],
keywords="DOI, RePEc, Rich Context, discovery, federated API, federated metadata, knowledge graph, metadata API, metadata exchange, metadata, persistent identifiers, research publication ontology, research publications, scholarly infrastructure, scholarly metadata, scholarly publishing",
license="MIT",
include_package_data=True,
zip_safe=False
)
File renamed without changes.
File renamed without changes.

0 comments on commit 992a84c

Please sign in to comment.