@@ -23,43 +23,36 @@ def abstract(self) -> Optional[str]:
23
23
abstract = abstract .strip ()
24
24
return abstract
25
25
26
-
27
26
@property
28
27
def aggregationType (self ) -> Optional [str ]:
29
28
"""The aggregation type of a document."""
30
29
return chained_get (self ._json , ['coredata' , 'prism:aggregationType' ])
31
30
32
-
33
31
@property
34
32
def authors (self ) -> Optional [list ]:
35
33
"""The authors of a document."""
36
34
out = []
37
35
auth = namedtuple ('Author' , 'surname given_name' )
38
36
for author in chained_get (self ._json , ['coredata' , 'dc:creator' ]):
39
37
surname , given_name = author ['$' ].split (',' )
40
- new = auth (surname = surname ,
41
- given_name = given_name )
38
+ new = auth (surname = surname , given_name = given_name )
42
39
out .append (new )
43
40
return out or None
44
41
45
-
46
42
@property
47
43
def copyright (self ) -> Optional [str ]:
48
44
"""The copyright of a document."""
49
45
return chained_get (self ._json , ['coredata' , 'prism:copyright' ])
50
46
51
-
52
47
@property
53
48
def coverDate (self ) -> Optional [str ]:
54
49
"""The date of the cover the document is in."""
55
50
return chained_get (self ._json , ['coredata' , 'prism:coverDate' ])
56
51
57
-
58
52
@property
59
53
def coverDisplayDate (self ) -> Optional [str ]:
60
54
"""The cover display date of a document."""
61
55
return chained_get (self ._json , ['coredata' , 'prism:coverDisplayDate' ])
62
-
63
56
64
57
@property
65
58
def document_entitlement_status (self ) -> Optional [str ]:
@@ -69,106 +62,89 @@ def document_entitlement_status(self) -> Optional[str]:
69
62
"""
70
63
return chained_get (self ._json , ['document-entitlement' , 'status' ])
71
64
72
-
73
65
@property
74
66
def doi (self ) -> str :
75
67
"""The doi of a document."""
76
68
return chained_get (self ._json , ['coredata' , 'prism:doi' ])
77
69
78
-
79
70
@property
80
71
def eid (self ) -> Optional [str ]:
81
72
"""The eid of a document."""
82
73
return chained_get (self ._json , ['coredata' , 'eid' ])
83
74
84
-
85
75
@property
86
76
def endingPage (self ) -> Optional [str ]:
87
77
"""The ending page of a document."""
88
78
page = chained_get (self ._json , ['coredata' , 'prism:endingPage' ])
89
79
return page
90
80
91
-
92
81
@property
93
82
def issn (self ) -> int :
94
83
"""The issn of a document."""
95
84
return make_int_if_possible (chained_get (self ._json , ['coredata' , 'prism:issn' ]))
96
85
97
-
98
86
@property
99
87
def openaccess (self ) -> bool :
100
88
"""The document is open access."""
101
89
open_access = chained_get (self ._json , ['coredata' , 'openaccessArticle' ])
102
90
return make_bool_if_possible (open_access )
103
91
104
-
105
92
@property
106
93
def openaccessSponsorName (self ) -> Optional [str ]:
107
94
"""The open access sponsor name of a document."""
108
95
return chained_get (self ._json , ['coredata' , 'openaccessSponsorName' ])
109
96
110
-
111
97
@property
112
98
def openaccessSponsorType (self ) -> Optional [str ]:
113
99
"""The open access sponsor type of a document."""
114
100
return chained_get (self ._json , ['coredata' , 'openaccessSponsorType' ])
115
101
116
-
117
102
@property
118
103
def openaccessType (self ) -> Optional [str ]:
119
104
"""The open access type of a document."""
120
105
return chained_get (self ._json , ['coredata' , 'openaccessType' ])
121
106
122
-
123
107
@property
124
108
def openaccessUserLicense (self ) -> Optional [str ]:
125
109
"""The open access user license of a document."""
126
110
return chained_get (self ._json , ['coredata' , 'openaccessUserLicense' ])
127
111
128
-
129
112
@property
130
113
def openArchiveArticle (self ) -> bool :
131
114
"""The document is an open archive article."""
132
115
open_archive = chained_get (self ._json , ['coredata' , 'openArchiveArticle' ])
133
116
return make_bool_if_possible (open_archive )
134
117
135
-
136
118
@property
137
119
def originalText (self ) -> Optional [str ]:
138
120
"""Complete document text."""
139
121
return self ._json .get ('originalText' )
140
122
141
-
142
123
@property
143
124
def pageRange (self ) -> Optional [str ]:
144
125
"""The prism:pageRange of a document."""
145
126
return chained_get (self ._json , ['coredata' , 'prism:pageRange' ])
146
127
147
-
148
128
@property
149
129
def publicationName (self ) -> str :
150
130
"""The publication name of a document (e.g. Journal of Economy and Technology)."""
151
131
return chained_get (self ._json , ['coredata' , 'prism:publicationName' ])
152
132
153
-
154
133
@property
155
134
def publisher (self ) -> Optional [str ]:
156
135
"""The publisher of a document."""
157
136
return chained_get (self ._json , ['coredata' , 'prism:publisher' ])
158
137
159
-
160
138
@property
161
139
def pubType (self ) -> Optional [str ]:
162
140
"""The publication type of a document."""
163
141
return chained_get (self ._json , ['coredata' , 'pubType' ])
164
142
165
-
166
143
@property
167
144
def pii (self ) -> str :
168
145
"""The pii of a document."""
169
146
return chained_get (self ._json , ['coredata' , 'pii' ])
170
147
171
-
172
148
@property
173
149
def sciencedirect_link (self ) -> str :
174
150
"""The ScienceDirect link of a document."""
@@ -177,7 +153,6 @@ def sciencedirect_link(self) -> str:
177
153
if link ['@rel' ] == 'scidir' :
178
154
return link ['@href' ]
179
155
180
-
181
156
@property
182
157
def self_link (self ) -> str :
183
158
"""The API link of a document."""
@@ -186,39 +161,33 @@ def self_link(self) -> str:
186
161
if link ['@rel' ] == 'self' :
187
162
return link ['@href' ]
188
163
189
-
190
164
@property
191
165
def startingPage (self ) -> Optional [str ]:
192
166
"""The starting page of a document."""
193
167
return chained_get (self ._json , ['coredata' , 'prism:startingPage' ])
194
168
195
-
196
169
@property
197
170
def subjects (self ) -> Optional [str ]:
198
171
"""The subjects of a document."""
199
172
subjects = chained_get (self ._json , ['coredata' , 'dcterms:subject' ])
200
173
return [subject ['$' ] for subject in subjects ]
201
174
202
-
203
175
@property
204
176
def title (self ) -> str :
205
177
"""The title of a document."""
206
178
return chained_get (self ._json , ['coredata' , 'dc:title' ])
207
179
208
-
209
180
@property
210
181
def url (self ) -> str :
211
182
"""The url of a document."""
212
183
return chained_get (self ._json , ['coredata' , 'prism:url' ])
213
184
214
-
215
185
@property
216
186
def volume (self ) -> Optional [str ]:
217
187
"""The prism:volume of a document."""
218
188
vol = chained_get (self ._json , ['coredata' , 'prism:volume' ])
219
189
return make_int_if_possible (vol )
220
190
221
-
222
191
def __init__ (self ,
223
192
identifier : Union [int , str ] = None ,
224
193
refresh : Union [bool , int ] = False ,
@@ -250,7 +219,6 @@ def __init__(self,
250
219
if self ._view != "ENTITLED" :
251
220
self ._json = self ._json ['full-text-retrieval-response' ]
252
221
253
-
254
222
def __str__ (self ):
255
223
s = ''
256
224
if self ._view in ('FULL' , 'META_ABS' , 'META' ):
0 commit comments