@@ -35,8 +35,8 @@ def __init__(
35
35
retry : bool = True ,
36
36
) -> None :
37
37
'''
38
- :param float timeout: (optional) an exception is raised\
39
- if the server has not issued a response for timeout seconds.
38
+ :param float timeout: (optional) an exception is raised
39
+ if the server has not issued a response for timeout seconds.
40
40
:param str api_key: (optional) private API key.
41
41
:param str api_url: (optional) custom API url.
42
42
:param bool debug: (optional) enable debug mode.
@@ -124,13 +124,14 @@ async def get_paper(
124
124
paper_id : str ,
125
125
fields : list = None
126
126
) -> Paper :
127
- '''Paper lookup
127
+ '''
128
+ Paper lookup
128
129
129
130
:calls: `GET /graph/v1/paper/{paper_id} \
130
131
<https://api.semanticscholar.org/api-docs/graph#tag/Paper-Data\
131
132
/operation/get_graph_get_paper>`_
132
133
133
- :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL, \
134
+ :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,
134
135
PMID, PMCID, or URL from:
135
136
136
137
- semanticscholar.org
@@ -165,13 +166,14 @@ async def get_papers(
165
166
fields : list = None ,
166
167
return_not_found : bool = False
167
168
) -> Union [List [Paper ], Tuple [List [Paper ], List [str ]]]:
168
- '''Get details for multiple papers at once
169
+ '''
170
+ Get details for multiple papers at once
169
171
170
172
:calls: `POST /graph/v1/paper/batch \
171
173
<https://api.semanticscholar.org/api-docs/graph#tag/Paper-Data\
172
174
/operation/post_graph_get_papers>`_
173
175
174
- :param str paper_ids: list of IDs (must be <= 500) - S2PaperId,\
176
+ :param str paper_ids: list of IDs (must be <= 500) - S2PaperId,
175
177
CorpusId, DOI, ArXivId, MAG, ACL, PMID, PMCID, or URL from:
176
178
177
179
- semanticscholar.org
@@ -181,13 +183,13 @@ async def get_papers(
181
183
- biorxiv.org
182
184
183
185
:param list fields: (optional) list of the fields to be returned.
184
- :param bool return_not_found: (optional) flag to include not found IDs\
185
- in the return, except for IDs in URL:<url> format.
186
+ :param bool return_not_found: (optional) flag to include not found IDs
187
+ in the return, except for IDs in URL:<url> format.
186
188
:returns: papers data, and optionally list of IDs not found.
187
- :rtype: :class:`List` of :class:`semanticscholar.Paper.Paper`\
188
- or :class:`Tuple` [:class:`List` of\
189
- :class:`semanticscholar.Paper.Paper`,\
190
- :class:`List` of :class:`str`]
189
+ :rtype: :class:`List` of :class:`semanticscholar.Paper.Paper`
190
+ or :class:`Tuple` [:class:`List` of
191
+ :class:`semanticscholar.Paper.Paper`,
192
+ :class:`List` of :class:`str`]
191
193
:raises: BadQueryParametersException: if no paper was found.
192
194
'''
193
195
@@ -251,13 +253,14 @@ async def get_paper_authors(
251
253
fields : list = None ,
252
254
limit : int = 100
253
255
) -> PaginatedResults :
254
- '''Get details about a paper's authors
256
+ '''
257
+ Get details about a paper's authors
255
258
256
259
:calls: `POST /graph/v1/paper/{paper_id}/authors \
257
260
<https://api.semanticscholar.org/api-docs/graph#tag/Paper-Data\
258
261
/operation/get_graph_get_paper_authors>`_
259
262
260
- :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,\
263
+ :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,
261
264
PMID, PMCID, or URL from:
262
265
263
266
- semanticscholar.org
@@ -267,7 +270,7 @@ async def get_paper_authors(
267
270
- biorxiv.org
268
271
269
272
:param list fields: (optional) list of the fields to be returned.
270
- :param int limit: (optional) maximum number of results to return\
273
+ :param int limit: (optional) maximum number of results to return
271
274
(must be <= 1000).
272
275
'''
273
276
@@ -298,13 +301,14 @@ async def get_paper_citations(
298
301
fields : list = None ,
299
302
limit : int = 100
300
303
) -> PaginatedResults :
301
- '''Get details about a paper's citations
304
+ '''
305
+ Get details about a paper's citations
302
306
303
307
:calls: `POST /graph/v1/paper/{paper_id}/citations \
304
308
<https://api.semanticscholar.org/api-docs/graph#tag/Paper-Data\
305
309
/operation/get_graph_get_paper_citations>`_
306
310
307
- :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,\
311
+ :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,
308
312
PMID, PMCID, or URL from:
309
313
310
314
- semanticscholar.org
@@ -314,7 +318,7 @@ async def get_paper_citations(
314
318
- biorxiv.org
315
319
316
320
:param list fields: (optional) list of the fields to be returned.
317
- :param int limit: (optional) maximum number of results to return\
321
+ :param int limit: (optional) maximum number of results to return
318
322
(must be <= 1000).
319
323
'''
320
324
@@ -344,13 +348,14 @@ async def get_paper_references(
344
348
fields : list = None ,
345
349
limit : int = 100
346
350
) -> PaginatedResults :
347
- '''Get details about a paper's references
351
+ '''
352
+ Get details about a paper's references
348
353
349
354
:calls: `POST /graph/v1/paper/{paper_id}/references \
350
355
<https://api.semanticscholar.org/api-docs/graph#tag/Paper-Data\
351
356
/operation/get_graph_get_paper_references>`_
352
357
353
- :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,\
358
+ :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,
354
359
PMID, PMCID, or URL from:
355
360
356
361
- semanticscholar.org
@@ -360,7 +365,7 @@ async def get_paper_references(
360
365
- biorxiv.org
361
366
362
367
:param list fields: (optional) list of the fields to be returned.
363
- :param int limit: (optional) maximum number of results to return\
368
+ :param int limit: (optional) maximum number of results to return
364
369
(must be <= 1000).
365
370
'''
366
371
@@ -400,50 +405,51 @@ async def search_paper(
400
405
sort : str = None ,
401
406
match_title : bool = False
402
407
) -> Union [PaginatedResults , Paper ]:
403
- '''Search for papers by keyword. Performs a search query based on the \
404
- S2 search relevance algorithm, or a bulk retrieval of basic paper \
405
- data without search relevance (if bulk=True). Paper relevance \
406
- search is the default behavior and returns up to 1,000 results. \
407
- Bulk retrieval instead returns up to 10,000,000 results (1,000 \
408
- in each page).
408
+ '''
409
+ Search for papers by keyword. Performs a search query based on the
410
+ S2 search relevance algorithm, or a bulk retrieval of basic paper
411
+ data without search relevance (if bulk=True). Paper relevance
412
+ search is the default behavior and returns up to 1,000 results.
413
+ Bulk retrieval instead returns up to 10,000,000 results (1,000
414
+ in each page).
409
415
410
416
:calls: `GET /graph/v1/paper/search \
411
- <https://api.semanticscholar.org/api-docs/graph#tag/Paper-Data \
412
- /operation/get_graph_paper_relevance_search>`_
417
+ <https://api.semanticscholar.org/api-docs/graph#tag/\
418
+ Paper-Data /operation/get_graph_paper_relevance_search>`_
413
419
:calls: `GET /graph/v1/paper/search/bulk \
414
- <https://api.semanticscholar.org/api-docs/graph#tag/Paper-Data \
415
- /operation/get_graph_paper_bulk_search>`_
420
+ <https://api.semanticscholar.org/api-docs/graph#tag/\
421
+ Paper-Data /operation/get_graph_paper_bulk_search>`_
416
422
417
423
:param str query: plain-text search query string.
418
- :param str year: (optional) restrict results to the given range of \
424
+ :param str year: (optional) restrict results to the given range of
419
425
publication year.
420
- :param list publication_type: (optional) restrict results to the given \
426
+ :param list publication_type: (optional) restrict results to the given
421
427
publication type list.
422
- :param bool open_access_pdf: (optional) restrict results to papers \
428
+ :param bool open_access_pdf: (optional) restrict results to papers
423
429
with public PDFs.
424
430
:param list venue: (optional) restrict results to the given venue list.
425
- :param list fields_of_study: (optional) restrict results to given \
431
+ :param list fields_of_study: (optional) restrict results to given
426
432
field-of-study list, using the s2FieldsOfStudy paper field.
427
433
:param list fields: (optional) list of the fields to be returned.
428
- :param str publication_date_or_year: (optional) restrict results to \
429
- the given range of publication date in the format \
430
- <start_date>:<end_date>, where dates are in the format \
434
+ :param str publication_date_or_year: (optional) restrict results to
435
+ the given range of publication date in the format
436
+ <start_date>:<end_date>, where dates are in the format
431
437
YYYY-MM-DD, YYYY-MM, or YYYY.
432
- :param int min_citation_count: (optional) restrict results to papers \
438
+ :param int min_citation_count: (optional) restrict results to papers
433
439
with at least the given number of citations.
434
- :param int limit: (optional) maximum number of results to return \
440
+ :param int limit: (optional) maximum number of results to return
435
441
(must be <= 100).
436
- :param bool bulk: (optional) bulk retrieval of basic paper data \
437
- without search relevance (ignores the limit parameter if True \
442
+ :param bool bulk: (optional) bulk retrieval of basic paper data
443
+ without search relevance (ignores the limit parameter if True
438
444
and returns up to 1,000 results in each page).
439
- :param str sort: (optional) sorts results (only if bulk=True) using \
440
- <field>:<order> format, where "field" is either paperId, \
441
- publicationDate, or citationCount, and "order" is asc \
445
+ :param str sort: (optional) sorts results (only if bulk=True) using
446
+ <field>:<order> format, where "field" is either paperId,
447
+ publicationDate, or citationCount, and "order" is asc
442
448
(ascending) or desc (descending).
443
- :param bool match_title: (optional) retrieve a single paper whose \
449
+ :param bool match_title: (optional) retrieve a single paper whose
444
450
title best matches the given query.
445
451
:returns: query results.
446
- :rtype: :class:`semanticscholar.PaginatedResults.PaginatedResults` or \
452
+ :rtype: :class:`semanticscholar.PaginatedResults.PaginatedResults` or
447
453
:class:`semanticscholar.Paper.Paper`
448
454
'''
449
455
@@ -521,7 +527,8 @@ async def get_author(
521
527
author_id : str ,
522
528
fields : list = None
523
529
) -> Author :
524
- '''Author lookup
530
+ '''
531
+ Author lookup
525
532
526
533
:calls: `GET /graph/v1/author/{author_id} \
527
534
<https://api.semanticscholar.org/api-docs/graph#tag/Author-Data\
@@ -553,18 +560,19 @@ async def get_authors(
553
560
fields : list = None ,
554
561
return_not_found : bool = False
555
562
) -> Union [List [Author ], Tuple [List [Author ], List [str ]]]:
556
- '''Get details for multiple authors at once
563
+ '''
564
+ Get details for multiple authors at once
557
565
558
566
:calls: `POST /graph/v1/author/batch \
559
567
<https://api.semanticscholar.org/api-docs/graph#tag/Author-Data\
560
568
/operation/get_graph_get_author>`_
561
569
562
570
:param str author_ids: list of S2AuthorId (must be <= 1000).
563
571
:returns: author data, and optionally list of IDs not found.
564
- :rtype: :class:`List` of :class:`semanticscholar.Author.Author`\
565
- or :class:`Tuple` [:class:`List` of\
566
- :class:`semanticscholar.Author.Author`,\
567
- :class:`List` of :class:`str`]
572
+ :rtype: :class:`List` of :class:`semanticscholar.Author.Author`
573
+ or :class:`Tuple` [:class:`List` of
574
+ :class:`semanticscholar.Author.Author`,
575
+ :class:`List` of :class:`str`]
568
576
:raises: BadQueryParametersException: if no author was found.
569
577
'''
570
578
@@ -601,13 +609,14 @@ async def get_author_papers(
601
609
fields : list = None ,
602
610
limit : int = 100
603
611
) -> PaginatedResults :
604
- '''Get details about a author's papers
612
+ '''
613
+ Get details about a author's papers
605
614
606
615
:calls: `POST /graph/v1/paper/{author_id}/papers \
607
616
<https://api.semanticscholar.org/api-docs/graph#tag/Paper-Data\
608
617
/operation/get_graph_get_author_papers>`_
609
618
610
- :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,\
619
+ :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,
611
620
PMID, PMCID, or URL from:
612
621
613
622
- semanticscholar.org
@@ -617,7 +626,7 @@ async def get_author_papers(
617
626
- biorxiv.org
618
627
619
628
:param list fields: (optional) list of the fields to be returned.
620
- :param int limit: (optional) maximum number of results to return\
629
+ :param int limit: (optional) maximum number of results to return
621
630
(must be <= 1000).
622
631
'''
623
632
@@ -647,15 +656,16 @@ async def search_author(
647
656
fields : list = None ,
648
657
limit : int = 100
649
658
) -> PaginatedResults :
650
- '''Search for authors by name
659
+ '''
660
+ Search for authors by name
651
661
652
662
:calls: `GET /graph/v1/author/search \
653
663
<https://api.semanticscholar.org/api-docs/graph#tag/Author-Data\
654
664
/operation/get_graph_get_author_search>`_
655
665
656
666
:param str query: plain-text search query string.
657
667
:param list fields: (optional) list of the fields to be returned.
658
- :param int limit: (optional) maximum number of results to return \
668
+ :param int limit: (optional) maximum number of results to return
659
669
(must be <= 1000).
660
670
:returns: query results.
661
671
:rtype: :class:`semanticscholar.PaginatedResults.PaginatedResults`
@@ -691,13 +701,14 @@ async def get_recommended_papers(
691
701
limit : int = 100 ,
692
702
pool_from : Literal ["recent" , "all-cs" ] = "recent"
693
703
) -> List [Paper ]:
694
- '''Get recommended papers for a single positive example.
704
+ '''
705
+ Get recommended papers for a single positive example.
695
706
696
707
:calls: `GET /recommendations/v1/papers/forpaper/{paper_id} \
697
708
<https://api.semanticscholar.org/api-docs/recommendations#\
698
709
tag/Paper-Recommendations/operation/get_papers_for_paper>`_
699
710
700
- :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,\
711
+ :param str paper_id: S2PaperId, CorpusId, DOI, ArXivId, MAG, ACL,
701
712
PMID, PMCID, or URL from:
702
713
703
714
- semanticscholar.org
@@ -707,10 +718,10 @@ async def get_recommended_papers(
707
718
- biorxiv.org
708
719
709
720
:param list fields: (optional) list of the fields to be returned.
710
- :param int limit: (optional) maximum number of recommendations to \
711
- return (must be <= 500).
712
- :param str pool_from: (optional) which pool of papers to recommend \
713
- from. Must be either "recent" or "all-cs".
721
+ :param int limit: (optional) maximum number of recommendations to
722
+ return (must be <= 500).
723
+ :param str pool_from: (optional) which pool of papers to recommend
724
+ from. Must be either "recent" or "all-cs".
714
725
:returns: list of recommendations.
715
726
:rtype: :class:`List` of :class:`semanticscholar.Paper.Paper`
716
727
'''
@@ -744,19 +755,20 @@ async def get_recommended_papers_from_lists(
744
755
fields : list = None ,
745
756
limit : int = 100
746
757
) -> List [Paper ]:
747
- '''Get recommended papers for lists of positive and negative examples.
758
+ '''
759
+ Get recommended papers for lists of positive and negative examples.
748
760
749
761
:calls: `POST /recommendations/v1/papers/ \
750
762
<https://api.semanticscholar.org/api-docs/recommendations#\
751
763
tag/Paper-Recommendations/operation/post_papers>`_
752
764
753
- :param list positive_paper_ids: list of paper IDs \
754
- that the returned papers should be related to.
755
- :param list negative_paper_ids: (optional) list of paper IDs \
756
- that the returned papers should not be related to.
765
+ :param list positive_paper_ids: list of paper IDs
766
+ that the returned papers should be related to.
767
+ :param list negative_paper_ids: (optional) list of paper IDs
768
+ that the returned papers should not be related to.
757
769
:param list fields: (optional) list of the fields to be returned.
758
- :param int limit: (optional) maximum number of recommendations to \
759
- return (must be <= 500).
770
+ :param int limit: (optional) maximum number of recommendations to
771
+ return (must be <= 500).
760
772
:returns: list of recommendations.
761
773
:rtype: :class:`List` of :class:`semanticscholar.Paper.Paper`
762
774
'''
0 commit comments