11from collections import defaultdict , namedtuple
2- from typing import List , NamedTuple , Optional , Tuple , Union
2+ from typing import Optional , Union
33
44from pybliometrics .superclasses import Retrieval
55from pybliometrics .utils import chained_get , check_parameter_value , \
@@ -16,7 +16,7 @@ def abstract(self) -> Optional[str]:
1616 return self ._head .get ('abstracts' )
1717
1818 @property
19- def affiliation (self ) -> Optional [List [ NamedTuple ]]:
19+ def affiliation (self ) -> Optional [list [ namedtuple ]]:
2020 """A list of namedtuples representing listed affiliations in
2121 the form `(id, name, city, country)`.
2222 """
@@ -36,7 +36,7 @@ def aggregationType(self) -> str:
3636 return chained_get (self ._json , ['coredata' , 'prism:aggregationType' ])
3737
3838 @property
39- def authkeywords (self ) -> Optional [List [str ]]:
39+ def authkeywords (self ) -> Optional [list [str ]]:
4040 """List of author-provided keywords of the document."""
4141 keywords = self ._json .get ('authkeywords' )
4242 if not keywords :
@@ -48,7 +48,7 @@ def authkeywords(self) -> Optional[List[str]]:
4848 return [keywords ['author-keyword' ]['$' ]]
4949
5050 @property
51- def authorgroup (self ) -> Optional [List [ NamedTuple ]]:
51+ def authorgroup (self ) -> Optional [list [ namedtuple ]]:
5252 """A list of namedtuples representing the article's authors and collaborations
5353 organized by affiliation, in the form `(affiliation_id, collaboration_id, dptid,
5454 organization, city, postalcode, addresspart, country, auid, orcid,
@@ -102,7 +102,7 @@ def authorgroup(self) -> Optional[List[NamedTuple]]:
102102 return out or None
103103
104104 @property
105- def authors (self ) -> Optional [List [ NamedTuple ]]:
105+ def authors (self ) -> Optional [list [ namedtuple ]]:
106106 """A list of namedtuples representing the article's authors, in the
107107 form `(auid, indexed_name, surname, given_name, affiliation)`. In case
108108 multiple affiliation IDs are given, they are joined on `";"`.
@@ -137,7 +137,7 @@ def citedby_link(self) -> str:
137137 return get_link (self ._json , 2 )
138138
139139 @property
140- def chemicals (self ) -> Optional [List [ NamedTuple ]]:
140+ def chemicals (self ) -> Optional [list [ namedtuple ]]:
141141 """List of namedtuples representing chemical entities in the form
142142 `(source, chemical_name, cas_registry_number)`. In case multiple
143143 numbers given, they are joined on `";"`.
@@ -165,7 +165,7 @@ def confcode(self) -> Optional[int]:
165165 return make_int_if_possible (self ._confevent .get ('confcode' ))
166166
167167 @property
168- def confdate (self ) -> Optional [Tuple [ Tuple [ int , int ], Tuple [int , int ] ]]:
168+ def confdate (self ) -> Optional [tuple [ int , int ], tuple [int , int ]]:
169169 """Date range of the conference the document belongs to represented
170170 by two tuples in the form (YYYY, MM, DD).
171171 """
@@ -189,7 +189,7 @@ def confname(self) -> Optional[str]:
189189 return self ._confevent .get ('confname' )
190190
191191 @property
192- def confsponsor (self ) -> Optional [Union [List [str ], str ]]:
192+ def confsponsor (self ) -> Optional [Union [list [str ], str ]]:
193193 """Sponsor(s) of the conference the document belongs to."""
194194 path = ['confsponsors' , 'confsponsor' ]
195195 sponsors = chained_get (self ._confevent , path , [])
@@ -200,7 +200,7 @@ def confsponsor(self) -> Optional[Union[List[str], str]]:
200200 return sponsors
201201
202202 @property
203- def contributor_group (self ) -> Optional [List [ NamedTuple ]]:
203+ def contributor_group (self ) -> Optional [list [ namedtuple ]]:
204204 """List of namedtuples representing contributors compiled by Scopus,
205205 in the form `(given_name, initials, surname, indexed_name, role)`.
206206 """
@@ -231,7 +231,7 @@ def copyright_type(self) -> str:
231231 return chained_get (self ._json , path )
232232
233233 @property
234- def correspondence (self ) -> Optional [List [ NamedTuple ]]:
234+ def correspondence (self ) -> Optional [list [ namedtuple ]]:
235235 """List of namedtuples representing the authors to whom correspondence
236236 should be addressed, in the form ´(surname, initials, organization,
237237 country, city_group)´. Multiple organziations are joined on semicolon.
@@ -263,7 +263,7 @@ def coverDate(self) -> str:
263263 return chained_get (self ._json , ['coredata' , 'prism:coverDate' ])
264264
265265 @property
266- def date_created (self ) -> Optional [Tuple [int , int , int ]]:
266+ def date_created (self ) -> Optional [tuple [int , int , int ]]:
267267 """Return the `date_created` of a record.
268268 """
269269 path = ["item" , "bibrecord" , "item-info" , "history" ]
@@ -309,7 +309,7 @@ def endingPage(self) -> Optional[str]:
309309 return ending
310310
311311 @property
312- def funding (self ) -> Optional [List [ NamedTuple ]]:
312+ def funding (self ) -> Optional [list [ namedtuple ]]:
313313 """List of namedtuples parsed funding information in the form
314314 `(agency, agency_id, string, funding_id, acronym, country)`.
315315 """
@@ -343,7 +343,7 @@ def funding_text(self) -> Optional[str]:
343343 return chained_get (self ._json , path )
344344
345345 @property
346- def isbn (self ) -> Optional [Tuple [str , ...]]:
346+ def isbn (self ) -> Optional [tuple [str , ...]]:
347347 """ISBNs `Optional[str]` to publicationName as tuple of variying length,
348348 (e.g. ISBN-10 or ISBN-13)."""
349349 isbns = listify (chained_get (self ._head , ['source' , 'isbn' ], []))
@@ -353,7 +353,7 @@ def isbn(self) -> Optional[Tuple[str, ...]]:
353353 return tuple ((i ['$' ] for i in isbns ))
354354
355355 @property
356- def issn (self ) -> Optional [NamedTuple ]:
356+ def issn (self ) -> Optional [namedtuple ]:
357357 """Namedtuple in the form `(print electronic)`.
358358 Note: If the source has an E-ISSN, the META view will return None.
359359 Use FULL view instead.
@@ -393,7 +393,7 @@ def identifier(self) -> int:
393393 return get_id (self ._json )
394394
395395 @property
396- def idxterms (self ) -> Optional [List [str ]]:
396+ def idxterms (self ) -> Optional [list [str ]]:
397397 """List of index terms (these are just one category of those
398398 Scopus provides in the web version)
399399 ."""
@@ -494,7 +494,7 @@ def refcount(self) -> Optional[int]:
494494 return None
495495
496496 @property
497- def references (self ) -> Optional [List [ NamedTuple ]]:
497+ def references (self ) -> Optional [list [ namedtuple ]]:
498498 """List of namedtuples representing references listed in the document,
499499 in the form `(position, id, doi, title, authors, authors_auid,
500500 authors_affiliationid, sourcetitle, publicationyear, coverDate, volume,
@@ -589,7 +589,7 @@ def self_link(self) -> str:
589589 return get_link (self ._json , 0 )
590590
591591 @property
592- def sequencebank (self ) -> Optional [List [ NamedTuple ]]:
592+ def sequencebank (self ) -> Optional [list [ namedtuple ]]:
593593 """List of namedtuples representing biological entities defined or
594594 mentioned in the text, in the form `(name, sequence_number, type)`.
595595 """
@@ -636,7 +636,7 @@ def startingPage(self) -> Optional[str]:
636636 return starting
637637
638638 @property
639- def subject_areas (self ) -> Optional [List [ NamedTuple ]]:
639+ def subject_areas (self ) -> Optional [list [ namedtuple ]]:
640640 """List of namedtuples containing subject areas of the article
641641 in the form `(area abbreviation code)`.
642642 Note: Requires the FULL view of the article.
0 commit comments