Mendeley / mendeley-api-python-catalog-example

This is a simple example of an application that consumes the Mendeley API, using the Python SDK.
Apache License 2.0
22 stars 6 forks source link

mendeley.exception.MendeleyException: Catalog document not found following example #2

Closed silpol closed 9 years ago

silpol commented 9 years ago

I have fetched git repo and made "pip install -r requirements.txt" and checked that everything has installed.

silpol@hostname:/tmp/mendeley-api-python-catalog-example$ pip install -r requirements.txt -U
Requirement already up-to-date: PyYAML==3.11 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already up-to-date: argparse==1.2.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2))
Requirement already up-to-date: arrow==0.5.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 3))
Requirement already up-to-date: certifi==14.05.14 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 4))
Requirement already up-to-date: future==0.14.3 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 5))
Requirement already up-to-date: memoized-property==1.0.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 6))
Requirement already up-to-date: mendeley==0.3.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 7))
Requirement already up-to-date: oauthlib==0.7.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 8))
Requirement already up-to-date: python-dateutil==2.4.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 9))
Requirement already up-to-date: requests==2.5.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 10))
Requirement already up-to-date: requests-oauthlib==0.4.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 11))
Requirement already up-to-date: six==1.9.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 12))
Requirement already up-to-date: wsgiref==0.1.2 in /usr/lib/python2.7 (from -r requirements.txt (line 13))

Then I re-used OAuth credentials from previous test. Then launched script as described in readme. It looks like OAuth passed just fine. Then I get prompt

Enter a DOI:

for which I provide DOI for existing document 10.1145/1815961.1816021

and then I get exception

silpol@hostname:/tmp/mendeley-api-python-catalog-example$ python mendeley-catalog.py 
Enter a DOI: 10.1145/1815961.1816021
Traceback (most recent call last):
  File "mendeley-catalog.py", line 12, in <module>
    doc = session.catalog.by_identifier(doi=doi, view='stats')
  File "/usr/local/lib/python2.7/dist-packages/mendeley/resources/catalog.py", line 47, in by_identifier
    raise MendeleyException('Catalog document not found')
mendeley.exception.MendeleyException: Catalog document not found

Is this expected behaviour or malfunction?

silpol commented 9 years ago

what is even more interesting - if I do not change anything and just type in different DOI, literally 10.1016/j.rser.2015.02.031 for another existing article - it goes just fine

silpol@hostname:/tmp/mendeley-api-python-catalog-example$ python mendeley-catalog.py 
Enter a DOI: 10.1016/j.rser.2015.02.031
"Early adopters boosting the diffusion of sustainable small-scale energy solutions" has 0 readers.
silpol@hostname:/tmp/mendeley-api-python-catalog-example$

and just as matter of a fact. both DOI - 10.1145/1815961.1816021 and 10.1016/j.rser.2015.02.031 make perfectly resolved to original pages by simple DOI verification tool, so now it looks more like bug to me.

Joyce-Stack commented 9 years ago

Hello silpol,

Receiving a 'Catalog document not found' error is a valid response as our catalog may not have that particular DOI.

Using CrossRef to check if it's a valid paper is OK but it does not mean it will be in our catalog as we don't have all CrossRef papers.

I have now made your paper "Debunking the 100X GPU vs. CPU myth: ..." available in our catalog.

We are trying to plan some catalog improvements so stay tuned.

silpol commented 9 years ago

ah, ok, so it is exception on lack of record in your DB. ok, case closed.