Resources¶
This page details the top-level resources that are available from a Mendeley session.
Documents¶
-
class
mendeley.resources.documents.
Documents
¶ Top-level resource for accessing documents. These can be:
- documents for the logged-in user, if retrieved from a
MendeleySession
. - documents in a
Group
.
-
advanced_search
(title=None, author=None, source=None, abstract=None, min_year=None, max_year=None, view=None)¶ Executes an advanced search in the logged-in user’s library, where individual fields can be searched on.
Parameters: - title – Title.
- author – Author.
- source – Source.
- abstract – Abstract.
- min_year – Minimum year for documents to return.
- max_year – Maximum year for documents to return.
- view – the view to get. One of ‘bib’, ‘client’, ‘tags’, ‘all’.
Returns: a
DocumentsSearch
resource, from which results can be retrieved.
-
create
(title, type, **kwargs)¶ Creates a new document from metadata.
Parameters: - title – title of the document.
- type – type of the document.
- kwargs – other properties of the document. These can be any of the attributes on
UserDocument
or any of its views.
Returns: a
UserDocument
.
-
create_from_file
(path)¶ Creates a new document from a file.
Parameters: path – path to the file. Returns: a UserDocument
.
-
get
(id, view=None)¶ Retrieves a document by ID.
Parameters: - id – the ID of the document to get.
- view – the view to get. One of ‘bib’, ‘client’, ‘tags’, ‘all’.
Returns: a
UserDocument
.
-
iter
(page_size=None, view=None, sort=None, order=None, modified_since=None, deleted_since=None)¶ Retrieves documents, as an iterator.
Parameters: - page_size – the number of documents to retrieve at a time. Defaults to 20.
- view – the view to get. One of ‘bib’, ‘client’, ‘tags’, ‘all’.
- sort – if specified, sorts documents by the specified field. One of ‘created’, ‘last_modified’, ‘title’.
- order – if specified in conjunction with ‘sort’, specifies the sort order. One of ‘asc’, ‘desc’.
- modified_since – if specified, only returns files modified after this timestamp.
- deleted_since – if specified, only returns the IDs of documents deleted after this timestamp.
Returns: an iterator of
UserDocuments
.
-
list
(page_size=None, view=None, sort=None, order=None, modified_since=None, deleted_since=None)¶ Retrieves documents, as a paginated collection.
Parameters: - page_size – the number of documents to return on each page. Defaults to 20.
- view – the view to get. One of ‘bib’, ‘client’, ‘tags’, ‘all’.
- sort – if specified, sorts documents by the specified field. One of ‘created’, ‘last_modified’, ‘title’.
- order – if specified in conjunction with ‘sort’, specifies the sort order. One of ‘asc’, ‘desc’.
- modified_since – if specified, only returns files modified after this timestamp.
- deleted_since – if specified, only returns the IDs of documents deleted after this timestamp.
Returns: a
Page
ofUserDocuments
.
-
search
(query, view=None)¶ Searches the logged-in user’s library for documents.
Parameters: - query – the search query to execute.
- view – the view to get. One of ‘bib’, ‘client’, ‘tags’, ‘all’.
Returns: a
DocumentsSearch
resource, from which results can be retrieved.
- documents for the logged-in user, if retrieved from a
-
class
mendeley.resources.trash.
Trash
¶ Top-level resource for accessing trashed documents. These can be:
- trashed documents for the logged-in user, if retrieved from a
MendeleySession
. - trashed documents in a
Group
.
-
get
(id, view=None)¶ Retrieves a trashed document by ID.
Parameters: - id – the ID of the document to get.
- view – the view to get. One of ‘bib’, ‘client’, ‘tags’, ‘all’.
Returns:
-
iter
(page_size=None, view=None, sort=None, order=None, modified_since=None, deleted_since=None)¶ Retrieves trashed documents, as an iterator.
Parameters: - page_size – the number of documents to retrieve at a time. Defaults to 20.
- view – the view to get. One of ‘bib’, ‘client’, ‘tags’, ‘all’.
- sort – if specified, sorts documents by the specified field. One of ‘created’, ‘last_modified’, ‘title’.
- order – if specified in conjunction with ‘sort’, specifies the sort order. One of ‘asc’, ‘desc’.
- modified_since – if specified, only returns files modified after this timestamp.
- deleted_since – if specified, only returns the IDs of documents deleted after this timestamp.
Returns: an iterator of
TrashDocuments
.
-
list
(page_size=None, view=None, sort=None, order=None, modified_since=None, deleted_since=None)¶ Retrieves trashed documents, as a paginated collection.
Parameters: - page_size – the number of documents to return on each page. Defaults to 20.
- view – the view to get. One of ‘bib’, ‘client’, ‘tags’, ‘all’.
- sort – if specified, sorts documents by the specified field. One of ‘created’, ‘last_modified’, ‘title’.
- order – if specified in conjunction with ‘sort’, specifies the sort order. One of ‘asc’, ‘desc’.
- modified_since – if specified, only returns files modified after this timestamp.
- deleted_since – if specified, only returns the IDs of documents deleted after this timestamp.
Returns: a
Page
ofTrashDocuments
.
- trashed documents for the logged-in user, if retrieved from a
Catalog¶
-
class
mendeley.resources.catalog.
Catalog
¶ Top-level resource for accessing catalog documents.
-
advanced_search
(title=None, author=None, source=None, abstract=None, min_year=None, max_year=None, open_access=None, view=None)¶ Executes an advanced catalog search, where individual fields can be searched on.
Parameters: - title – Title.
- author – Author.
- source – Source.
- abstract – Abstract.
- min_year – Minimum year for documents to return.
- max_year – Maximum year for documents to return.
- open_access – If ‘true’, only returns open access documents.
- view – the view to get. One of ‘bib’, ‘client’, ‘stats’, ‘all’.
Returns: a
CatalogSearch
resource, from which results can be retrieved.
-
by_identifier
(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.
Parameters: - arxiv – ArXiV ID.
- doi – DOI.
- isbn – ISBN.
- issn – ISSN.
- pmid – PubMed ID.
- scopus – Scopus ID (EID).
- filehash – SHA-1 filehash.
- view – the view to get. One of ‘bib’, ‘client’, ‘stats’, ‘all’.
Returns:
-
get
(id, view=None)¶ Retrieves a catalog document by ID.
Parameters: - id – the ID of the document to get.
- view – the view to get. One of ‘bib’, ‘client’, ‘stats’, ‘all’.
Returns:
-
lookup
(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.
Parameters: - arxiv – ArXiV ID.
- doi – DOI.
- pmid – PubMed ID.
- filehash – SHA-1 filehash.
- title – Title.
- authors – Authors.
- year – Year.
- source – Source.
- view – the view to get. One of ‘bib’, ‘client’, ‘stats’, ‘all’.
Returns:
-
search
(query, view=None)¶ Searches the catalog for documents.
Parameters: - query – the search query to execute.
- view – the view to get. One of ‘bib’, ‘client’, ‘stats’, ‘all’.
Returns: a
CatalogSearch
resource, from which results can be retrieved.
-
-
class
mendeley.resources.catalog.
CatalogSearch
¶ Resource for accessing the results of a catalog search.
-
iter
(page_size=None)¶ Retrieves search results, as an iterator.
Parameters: page_size – the number of search results to retrieve at a time. Defaults to 20. Returns: an iterator of CatalogDocuments
.
-
list
(page_size=None)¶ Retrieves search results, as a paginated collection.
Parameters: page_size – the number of search results to return on each page. Defaults to 20. Returns: a Page
ofCatalogDocuments
.
-
Files¶
-
class
mendeley.resources.files.
Files
¶ Top-level resource for accessing files. These can be:
- files for the logged-in user, if retrieved from a
MendeleySession
. - files attached to a
CatalogDocument
. - files attached to a
UserDocument
. - files in a
Group
.
-
iter
(page_size=None, added_since=None, deleted_since=None)¶ Retrieves files, as an iterator.
Parameters: - page_size – the number of files to retrieve at a time. Defaults to 20.
- added_since – if specified, only returns files added after this timestamp.
- deleted_since – if specified, only returns the IDs of files deleted after this timestamp.
Returns: an iterator of
Files
.
-
list
(page_size=None, added_since=None, deleted_since=None)¶ Retrieves files, as a paginated collection.
Parameters: - page_size – the number of files to return on each page. Defaults to 20.
- added_since – if specified, only returns files added after this timestamp.
- deleted_since – if specified, only returns the IDs of files deleted after this timestamp.
Returns:
- files for the logged-in user, if retrieved from a
Groups¶
-
class
mendeley.resources.groups.
Groups
¶ Top-level resource for accessing groups.
-
class
mendeley.resources.groups.
GroupMembers
¶ Resource for accessing members of a group.
-
iter
(page_size=None)¶ Retrieves members of the group, as an iterator.
Parameters: page_size – the number of members to retrieve at a time. Defaults to 20. Returns: an iterator of GroupMembers
.
-
list
(page_size=None)¶ Retrieves members of the group, as a paginated collection.
Parameters: page_size – the number of members to return on each page. Defaults to 20. Returns: a Page
ofGroupMembers
.
-
Profiles¶
Annotations¶
-
class
mendeley.resources.annotations.
Annotations
¶ Top-level resource for accessing annotations.
-
get
(id)¶ Retrieves an annotation by ID.
Parameters: id – the ID of the annotation to get. Returns: a Annotation
.
-
iter
(page_size=None, modified_since=None, deleted_since=None)¶ Retrieves annotations that the logged-in user is a member of, as an iterator.
Parameters: - page_size – the number of annotations to retrieve at a time. Defaults to 20.
- modified_since – if specified, only returns annotations modified after this timestamp.
- deleted_since – if specified, only returns the annotations deleted after this timestamp.
Returns: an iterator of
Annotations
.
-
list
(page_size=None, modified_since=None, deleted_since=None)¶ Retrieves annotations as a paginated collection.
Parameters: - page_size – the number of annotations to return on each page. Defaults to 20.
- modified_since – if specified, only returns annotations modified after this timestamp.
- deleted_since – if specified, only returns annotations deleted after this timestamp.
Returns: a
Page
of
-