Example #1
0
    def by_identifier(self, arxiv=None, doi=None, isbn=None, issn=None, pmid=None, scopus=None, filehash=None,
                      view=None):
        """
        Retrieves a catalog document by an external identifier.  Only one identifier may be specified.

        :param arxiv: ArXiV ID.
        :param doi: DOI.
        :param isbn: ISBN.
        :param issn: ISSN.
        :param pmid: PubMed ID.
        :param scopus: Scopus ID (EID).
        :param filehash: SHA-1 filehash.
        :param view: the view to get.  One of 'bib', 'client', 'stats', 'all'.
        :return: a :class:`CatalogDocument <mendeley.models.catalog.CatalogDocument>`.
        """
        url = add_query_params('/catalog', {'arxiv': arxiv, 'doi': doi, 'isbn': isbn, 'issn': issn, 'pmid': pmid,
                                            'scopus': scopus, 'filehash': filehash, 'view': view})
        obj_type = view_type(view)

        rsp = self.session.get(url, headers={'Accept': obj_type.content_type})

        if len(rsp.json()) == 0:
            raise MendeleyException('Catalog document not found')

        return obj_type(self.session, rsp.json()[0])
    def by_identifier(self, arxiv=None, doi=None, isbn=None, issn=None, pmid=None, scopus=None, filehash=None,
                      view=None):
        """
        Retrieves a dataset by an external identifier.  Only one identifier may be specified.

        :param arxiv: ArXiV ID.
        :param doi: DOI.
        :param isbn: ISBN.
        :param issn: ISSN.
        :param pmid: PubMed ID.
        :param scopus: Scopus ID (EID).
        :param filehash: SHA-1 filehash.
        :param view: the view to get.  One of 'bib', 'client', 'stats', 'all'.
        :return: a :class:`datasetDocument <mendeley.models.dataset.Dataset>`.
        """
        url = add_query_params('/dataset', {'arxiv': arxiv, 'doi': doi, 'isbn': isbn, 'issn': issn, 'pmid': pmid,
                                            'scopus': scopus, 'filehash': filehash, 'view': view})
        obj_type = view_type(view)

        rsp = self.session.get(url, headers={'Accept': obj_type.content_type})

        if len(rsp.json()) == 0:
            raise MendeleyException('dataset document not found')

        return obj_type(self.session, rsp.json()[0])
Example #3
0
    def lookup(self,
               arxiv=None,
               doi=None,
               pmid=None,
               filehash=None,
               title=None,
               authors=None,
               year=None,
               source=None,
               view=None):
        """
        Finds the closest matching catalog document to a supplied set of metadata.

        :param arxiv: ArXiV ID.
        :param doi: DOI.
        :param pmid: PubMed ID.
        :param filehash: SHA-1 filehash.
        :param title: Title.
        :param authors: Authors.
        :param year: Year.
        :param source: Source.
        :param view: the view to get.  One of 'bib', 'client', 'stats', 'all'.
        :return: a :class:`CatalogDocument <mendeley.models.catalog.CatalogDocument>`.
        """
        url = add_query_params(
            '/metadata', {
                'arxiv': arxiv,
                'doi': doi,
                'pmid': pmid,
                'filehash': filehash,
                'title': title,
                'authors': authors,
                'year': year,
                'source': source
            })
        obj_type = view_type(view)

        rsp = self.session.get(
            url,
            headers={
                'Accept': 'application/vnd.mendeley-document-lookup.1+json'
            })

        return LookupResponse(self.session, rsp.json(), view, obj_type)
Example #4
0
    def lookup(self, arxiv=None, doi=None, pmid=None, filehash=None, title=None, authors=None, year=None, source=None,
               view=None):
        """
        Finds the closest matching catalog document to a supplied set of metadata.

        :param arxiv: ArXiV ID.
        :param doi: DOI.
        :param pmid: PubMed ID.
        :param filehash: SHA-1 filehash.
        :param title: Title.
        :param authors: Authors.
        :param year: Year.
        :param source: Source.
        :param view: the view to get.  One of 'bib', 'client', 'stats', 'all'.
        :return: a :class:`CatalogDocument <mendeley.models.catalog.CatalogDocument>`.
        """
        url = add_query_params('/metadata', {'arxiv': arxiv, 'doi': doi, 'pmid': pmid, 'filehash': filehash,
                                             'title': title, 'authors': authors, 'year': year, 'source': source})
        obj_type = view_type(view)

        rsp = self.session.get(url, headers={'Accept': 'application/vnd.mendeley-document-lookup.1+json'})

        return LookupResponse(self.session, rsp.json(), view, obj_type)
Example #5
0
 def _url(self):
     return add_query_params('/search/catalog', self.params)
Example #6
0
 def _url(self):
     return add_query_params('/search/documents', self.params)
Example #7
0
 def _url(self):
     return add_query_params('/search/catalog', self.params)
 def _url(self):
     return add_query_params("/search/documents", self.params)
 def _url(self):
     return add_query_params('', self.params)