1
1
from collections import defaultdict , namedtuple
2
- from typing import List , NamedTuple , Optional , Tuple , Union
2
+ from typing import Optional , Union
3
3
4
4
from pybliometrics .superclasses import Retrieval
5
5
from pybliometrics .utils import chained_get , check_parameter_value , \
@@ -16,7 +16,7 @@ def abstract(self) -> Optional[str]:
16
16
return self ._head .get ('abstracts' )
17
17
18
18
@property
19
- def affiliation (self ) -> Optional [List [ NamedTuple ]]:
19
+ def affiliation (self ) -> Optional [list [ namedtuple ]]:
20
20
"""A list of namedtuples representing listed affiliations in
21
21
the form `(id, name, city, country)`.
22
22
"""
@@ -36,7 +36,7 @@ def aggregationType(self) -> str:
36
36
return chained_get (self ._json , ['coredata' , 'prism:aggregationType' ])
37
37
38
38
@property
39
- def authkeywords (self ) -> Optional [List [str ]]:
39
+ def authkeywords (self ) -> Optional [list [str ]]:
40
40
"""List of author-provided keywords of the document."""
41
41
keywords = self ._json .get ('authkeywords' )
42
42
if not keywords :
@@ -48,7 +48,7 @@ def authkeywords(self) -> Optional[List[str]]:
48
48
return [keywords ['author-keyword' ]['$' ]]
49
49
50
50
@property
51
- def authorgroup (self ) -> Optional [List [ NamedTuple ]]:
51
+ def authorgroup (self ) -> Optional [list [ namedtuple ]]:
52
52
"""A list of namedtuples representing the article's authors and collaborations
53
53
organized by affiliation, in the form `(affiliation_id, collaboration_id, dptid,
54
54
organization, city, postalcode, addresspart, country, auid, orcid,
@@ -102,7 +102,7 @@ def authorgroup(self) -> Optional[List[NamedTuple]]:
102
102
return out or None
103
103
104
104
@property
105
- def authors (self ) -> Optional [List [ NamedTuple ]]:
105
+ def authors (self ) -> Optional [list [ namedtuple ]]:
106
106
"""A list of namedtuples representing the article's authors, in the
107
107
form `(auid, indexed_name, surname, given_name, affiliation)`. In case
108
108
multiple affiliation IDs are given, they are joined on `";"`.
@@ -137,7 +137,7 @@ def citedby_link(self) -> str:
137
137
return get_link (self ._json , 2 )
138
138
139
139
@property
140
- def chemicals (self ) -> Optional [List [ NamedTuple ]]:
140
+ def chemicals (self ) -> Optional [list [ namedtuple ]]:
141
141
"""List of namedtuples representing chemical entities in the form
142
142
`(source, chemical_name, cas_registry_number)`. In case multiple
143
143
numbers given, they are joined on `";"`.
@@ -165,7 +165,7 @@ def confcode(self) -> Optional[int]:
165
165
return make_int_if_possible (self ._confevent .get ('confcode' ))
166
166
167
167
@property
168
- def confdate (self ) -> Optional [Tuple [ Tuple [ int , int ], Tuple [int , int ] ]]:
168
+ def confdate (self ) -> Optional [tuple [ int , int ], tuple [int , int ]]:
169
169
"""Date range of the conference the document belongs to represented
170
170
by two tuples in the form (YYYY, MM, DD).
171
171
"""
@@ -189,7 +189,7 @@ def confname(self) -> Optional[str]:
189
189
return self ._confevent .get ('confname' )
190
190
191
191
@property
192
- def confsponsor (self ) -> Optional [Union [List [str ], str ]]:
192
+ def confsponsor (self ) -> Optional [Union [list [str ], str ]]:
193
193
"""Sponsor(s) of the conference the document belongs to."""
194
194
path = ['confsponsors' , 'confsponsor' ]
195
195
sponsors = chained_get (self ._confevent , path , [])
@@ -200,7 +200,7 @@ def confsponsor(self) -> Optional[Union[List[str], str]]:
200
200
return sponsors
201
201
202
202
@property
203
- def contributor_group (self ) -> Optional [List [ NamedTuple ]]:
203
+ def contributor_group (self ) -> Optional [list [ namedtuple ]]:
204
204
"""List of namedtuples representing contributors compiled by Scopus,
205
205
in the form `(given_name, initials, surname, indexed_name, role)`.
206
206
"""
@@ -231,7 +231,7 @@ def copyright_type(self) -> str:
231
231
return chained_get (self ._json , path )
232
232
233
233
@property
234
- def correspondence (self ) -> Optional [List [ NamedTuple ]]:
234
+ def correspondence (self ) -> Optional [list [ namedtuple ]]:
235
235
"""List of namedtuples representing the authors to whom correspondence
236
236
should be addressed, in the form ´(surname, initials, organization,
237
237
country, city_group)´. Multiple organziations are joined on semicolon.
@@ -263,7 +263,7 @@ def coverDate(self) -> str:
263
263
return chained_get (self ._json , ['coredata' , 'prism:coverDate' ])
264
264
265
265
@property
266
- def date_created (self ) -> Optional [Tuple [int , int , int ]]:
266
+ def date_created (self ) -> Optional [tuple [int , int , int ]]:
267
267
"""Return the `date_created` of a record.
268
268
"""
269
269
path = ["item" , "bibrecord" , "item-info" , "history" ]
@@ -309,7 +309,7 @@ def endingPage(self) -> Optional[str]:
309
309
return ending
310
310
311
311
@property
312
- def funding (self ) -> Optional [List [ NamedTuple ]]:
312
+ def funding (self ) -> Optional [list [ namedtuple ]]:
313
313
"""List of namedtuples parsed funding information in the form
314
314
`(agency, agency_id, string, funding_id, acronym, country)`.
315
315
"""
@@ -343,7 +343,7 @@ def funding_text(self) -> Optional[str]:
343
343
return chained_get (self ._json , path )
344
344
345
345
@property
346
- def isbn (self ) -> Optional [Tuple [str , ...]]:
346
+ def isbn (self ) -> Optional [tuple [str , ...]]:
347
347
"""ISBNs `Optional[str]` to publicationName as tuple of variying length,
348
348
(e.g. ISBN-10 or ISBN-13)."""
349
349
isbns = listify (chained_get (self ._head , ['source' , 'isbn' ], []))
@@ -353,7 +353,7 @@ def isbn(self) -> Optional[Tuple[str, ...]]:
353
353
return tuple ((i ['$' ] for i in isbns ))
354
354
355
355
@property
356
- def issn (self ) -> Optional [NamedTuple ]:
356
+ def issn (self ) -> Optional [namedtuple ]:
357
357
"""Namedtuple in the form `(print electronic)`.
358
358
Note: If the source has an E-ISSN, the META view will return None.
359
359
Use FULL view instead.
@@ -393,7 +393,7 @@ def identifier(self) -> int:
393
393
return get_id (self ._json )
394
394
395
395
@property
396
- def idxterms (self ) -> Optional [List [str ]]:
396
+ def idxterms (self ) -> Optional [list [str ]]:
397
397
"""List of index terms (these are just one category of those
398
398
Scopus provides in the web version)
399
399
."""
@@ -494,7 +494,7 @@ def refcount(self) -> Optional[int]:
494
494
return None
495
495
496
496
@property
497
- def references (self ) -> Optional [List [ NamedTuple ]]:
497
+ def references (self ) -> Optional [list [ namedtuple ]]:
498
498
"""List of namedtuples representing references listed in the document,
499
499
in the form `(position, id, doi, title, authors, authors_auid,
500
500
authors_affiliationid, sourcetitle, publicationyear, coverDate, volume,
@@ -589,7 +589,7 @@ def self_link(self) -> str:
589
589
return get_link (self ._json , 0 )
590
590
591
591
@property
592
- def sequencebank (self ) -> Optional [List [ NamedTuple ]]:
592
+ def sequencebank (self ) -> Optional [list [ namedtuple ]]:
593
593
"""List of namedtuples representing biological entities defined or
594
594
mentioned in the text, in the form `(name, sequence_number, type)`.
595
595
"""
@@ -636,7 +636,7 @@ def startingPage(self) -> Optional[str]:
636
636
return starting
637
637
638
638
@property
639
- def subject_areas (self ) -> Optional [List [ NamedTuple ]]:
639
+ def subject_areas (self ) -> Optional [list [ namedtuple ]]:
640
640
"""List of namedtuples containing subject areas of the article
641
641
in the form `(area abbreviation code)`.
642
642
Note: Requires the FULL view of the article.
0 commit comments