@@ -23,43 +23,36 @@ def abstract(self) -> Optional[str]:
2323 abstract = abstract .strip ()
2424 return abstract
2525
26-
2726 @property
2827 def aggregationType (self ) -> Optional [str ]:
2928 """The aggregation type of a document."""
3029 return chained_get (self ._json , ['coredata' , 'prism:aggregationType' ])
3130
32-
3331 @property
3432 def authors (self ) -> Optional [list ]:
3533 """The authors of a document."""
3634 out = []
3735 auth = namedtuple ('Author' , 'surname given_name' )
3836 for author in chained_get (self ._json , ['coredata' , 'dc:creator' ]):
3937 surname , given_name = author ['$' ].split (',' )
40- new = auth (surname = surname ,
41- given_name = given_name )
38+ new = auth (surname = surname , given_name = given_name )
4239 out .append (new )
4340 return out or None
4441
45-
4642 @property
4743 def copyright (self ) -> Optional [str ]:
4844 """The copyright of a document."""
4945 return chained_get (self ._json , ['coredata' , 'prism:copyright' ])
5046
51-
5247 @property
5348 def coverDate (self ) -> Optional [str ]:
5449 """The date of the cover the document is in."""
5550 return chained_get (self ._json , ['coredata' , 'prism:coverDate' ])
5651
57-
5852 @property
5953 def coverDisplayDate (self ) -> Optional [str ]:
6054 """The cover display date of a document."""
6155 return chained_get (self ._json , ['coredata' , 'prism:coverDisplayDate' ])
62-
6356
6457 @property
6558 def document_entitlement_status (self ) -> Optional [str ]:
@@ -69,106 +62,89 @@ def document_entitlement_status(self) -> Optional[str]:
6962 """
7063 return chained_get (self ._json , ['document-entitlement' , 'status' ])
7164
72-
7365 @property
7466 def doi (self ) -> str :
7567 """The doi of a document."""
7668 return chained_get (self ._json , ['coredata' , 'prism:doi' ])
7769
78-
7970 @property
8071 def eid (self ) -> Optional [str ]:
8172 """The eid of a document."""
8273 return chained_get (self ._json , ['coredata' , 'eid' ])
8374
84-
8575 @property
8676 def endingPage (self ) -> Optional [str ]:
8777 """The ending page of a document."""
8878 page = chained_get (self ._json , ['coredata' , 'prism:endingPage' ])
8979 return page
9080
91-
9281 @property
9382 def issn (self ) -> int :
9483 """The issn of a document."""
9584 return make_int_if_possible (chained_get (self ._json , ['coredata' , 'prism:issn' ]))
9685
97-
9886 @property
9987 def openaccess (self ) -> bool :
10088 """The document is open access."""
10189 open_access = chained_get (self ._json , ['coredata' , 'openaccessArticle' ])
10290 return make_bool_if_possible (open_access )
10391
104-
10592 @property
10693 def openaccessSponsorName (self ) -> Optional [str ]:
10794 """The open access sponsor name of a document."""
10895 return chained_get (self ._json , ['coredata' , 'openaccessSponsorName' ])
10996
110-
11197 @property
11298 def openaccessSponsorType (self ) -> Optional [str ]:
11399 """The open access sponsor type of a document."""
114100 return chained_get (self ._json , ['coredata' , 'openaccessSponsorType' ])
115101
116-
117102 @property
118103 def openaccessType (self ) -> Optional [str ]:
119104 """The open access type of a document."""
120105 return chained_get (self ._json , ['coredata' , 'openaccessType' ])
121106
122-
123107 @property
124108 def openaccessUserLicense (self ) -> Optional [str ]:
125109 """The open access user license of a document."""
126110 return chained_get (self ._json , ['coredata' , 'openaccessUserLicense' ])
127111
128-
129112 @property
130113 def openArchiveArticle (self ) -> bool :
131114 """The document is an open archive article."""
132115 open_archive = chained_get (self ._json , ['coredata' , 'openArchiveArticle' ])
133116 return make_bool_if_possible (open_archive )
134117
135-
136118 @property
137119 def originalText (self ) -> Optional [str ]:
138120 """Complete document text."""
139121 return self ._json .get ('originalText' )
140122
141-
142123 @property
143124 def pageRange (self ) -> Optional [str ]:
144125 """The prism:pageRange of a document."""
145126 return chained_get (self ._json , ['coredata' , 'prism:pageRange' ])
146127
147-
148128 @property
149129 def publicationName (self ) -> str :
150130 """The publication name of a document (e.g. Journal of Economy and Technology)."""
151131 return chained_get (self ._json , ['coredata' , 'prism:publicationName' ])
152132
153-
154133 @property
155134 def publisher (self ) -> Optional [str ]:
156135 """The publisher of a document."""
157136 return chained_get (self ._json , ['coredata' , 'prism:publisher' ])
158137
159-
160138 @property
161139 def pubType (self ) -> Optional [str ]:
162140 """The publication type of a document."""
163141 return chained_get (self ._json , ['coredata' , 'pubType' ])
164142
165-
166143 @property
167144 def pii (self ) -> str :
168145 """The pii of a document."""
169146 return chained_get (self ._json , ['coredata' , 'pii' ])
170147
171-
172148 @property
173149 def sciencedirect_link (self ) -> str :
174150 """The ScienceDirect link of a document."""
@@ -177,7 +153,6 @@ def sciencedirect_link(self) -> str:
177153 if link ['@rel' ] == 'scidir' :
178154 return link ['@href' ]
179155
180-
181156 @property
182157 def self_link (self ) -> str :
183158 """The API link of a document."""
@@ -186,39 +161,33 @@ def self_link(self) -> str:
186161 if link ['@rel' ] == 'self' :
187162 return link ['@href' ]
188163
189-
190164 @property
191165 def startingPage (self ) -> Optional [str ]:
192166 """The starting page of a document."""
193167 return chained_get (self ._json , ['coredata' , 'prism:startingPage' ])
194168
195-
196169 @property
197170 def subjects (self ) -> Optional [str ]:
198171 """The subjects of a document."""
199172 subjects = chained_get (self ._json , ['coredata' , 'dcterms:subject' ])
200173 return [subject ['$' ] for subject in subjects ]
201174
202-
203175 @property
204176 def title (self ) -> str :
205177 """The title of a document."""
206178 return chained_get (self ._json , ['coredata' , 'dc:title' ])
207179
208-
209180 @property
210181 def url (self ) -> str :
211182 """The url of a document."""
212183 return chained_get (self ._json , ['coredata' , 'prism:url' ])
213184
214-
215185 @property
216186 def volume (self ) -> Optional [str ]:
217187 """The prism:volume of a document."""
218188 vol = chained_get (self ._json , ['coredata' , 'prism:volume' ])
219189 return make_int_if_possible (vol )
220190
221-
222191 def __init__ (self ,
223192 identifier : Union [int , str ] = None ,
224193 refresh : Union [bool , int ] = False ,
@@ -250,7 +219,6 @@ def __init__(self,
250219 if self ._view != "ENTITLED" :
251220 self ._json = self ._json ['full-text-retrieval-response' ]
252221
253-
254222 def __str__ (self ):
255223 s = ''
256224 if self ._view in ('FULL' , 'META_ABS' , 'META' ):
0 commit comments