sxolar.api.search
¶
Higher-level api for searching for papers, uses an object interface with overridden magic methods for syntactic sugar
Abstract
¶
Bases: Query
Represents an abstract query for the arxiv API
Source code in sxolar/api/search.py
358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
__init__(abstract)
¶
Creates a new abstract query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
abstract
|
str
|
str, the abstract of the paper |
required |
Source code in sxolar/api/search.py
361 362 363 364 365 366 367 368 369 370 |
|
All
¶
Bases: Query
Represents an all query for the arxiv API
Source code in sxolar/api/search.py
373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
__init__(all_)
¶
Creates a new all query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
all_
|
str
|
str, the value to search for |
required |
Source code in sxolar/api/search.py
376 377 378 379 380 381 382 383 384 385 |
|
Author
¶
Bases: Query
Represents an author query for the arxiv API
Source code in sxolar/api/search.py
328 329 330 331 332 333 334 335 336 337 338 339 340 |
|
__init__(name)
¶
Creates a new author query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
str, the name of the author, "First Last" |
required |
Source code in sxolar/api/search.py
331 332 333 334 335 336 337 338 339 340 |
|
Category
¶
Bases: Query
Represents a category query for the arxiv API
Source code in sxolar/api/search.py
403 404 405 406 407 408 409 410 411 412 413 414 |
|
__init__(category)
¶
Creates a new category query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
category
|
str
|
|
required |
Source code in sxolar/api/search.py
406 407 408 409 410 411 412 413 414 |
|
JournalRef
¶
Bases: Query
Represents a journal reference query for the arxiv API
Source code in sxolar/api/search.py
388 389 390 391 392 393 394 395 396 397 398 399 400 |
|
__init__(journal_ref)
¶
Creates a new journal reference query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
journal_ref
|
str
|
str, the journal reference |
required |
Source code in sxolar/api/search.py
391 392 393 394 395 396 397 398 399 400 |
|
Query
¶
Represents a query clause for the arxiv API
Attributes:
Name | Type | Description |
---|---|---|
value |
str
|
The value to search for |
operator |
str
|
The operator to use |
Source code in sxolar/api/search.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
|
__and__(other)
¶
Overloads the and operator to create a new query
Source code in sxolar/api/search.py
46 47 48 |
|
__init__(value, filter_authors=None)
¶
Creates a new query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
str, the value to search for |
required |
filter_authors
|
List[str]
|
List[str], the authors to filter by |
None
|
Source code in sxolar/api/search.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
__or__(other)
¶
Overloads the or operator to create a new query
Source code in sxolar/api/search.py
50 51 52 |
|
__str__()
¶
Returns the string representation of the query
Source code in sxolar/api/search.py
42 43 44 |
|
__sub__(other)
¶
Overloads the subtraction operator to create a new query
Source code in sxolar/api/search.py
54 55 56 |
|
and_(other)
¶
Join two queries with the AND operator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other
|
Union[str, Query]
|
str, the other query to join with |
required |
Returns:
Name | Type | Description |
---|---|---|
Query |
A new query object |
Source code in sxolar/api/search.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
and_not(other)
¶
Join two queries with the AND NOT operator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other
|
str, the other query to join with |
required |
Returns:
Name | Type | Description |
---|---|---|
Query |
A new query object |
Source code in sxolar/api/search.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
from_abstracts(*abstracts)
staticmethod
¶
Creates a new abstract query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
abstracts
|
Iterable[str]
|
str, the abstract of the paper |
()
|
Source code in sxolar/api/search.py
219 220 221 222 223 224 225 226 227 228 229 230 231 |
|
from_alls(*alls, operator=LogicalOperator.OR)
staticmethod
¶
Creates a new all query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
alls
|
Iterable[str]
|
str, the value to search for |
()
|
Source code in sxolar/api/search.py
233 234 235 236 237 238 239 240 241 242 243 244 245 |
|
from_authors(*authors)
staticmethod
¶
Creates a new author query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
authors
|
Iterable[str]
|
str, the name of the author, "First Last" |
()
|
Source code in sxolar/api/search.py
191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
from_categories(*categories)
staticmethod
¶
Creates a new category query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
categories
|
Iterable[str]
|
str, the category |
()
|
Source code in sxolar/api/search.py
261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
from_combo(authors=None, titles=None, abstracts=None, alls=None, journal_refs=None, categories=None, operator=LogicalOperator.AND, filter_authors=False, alls_operator=LogicalOperator.OR)
staticmethod
¶
Creates a new combo query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
authors
|
Iterable[str]
|
Iterable[str], the name of the author, "First Last" |
None
|
titles
|
Iterable[str]
|
Iterable[str], the title of the paper |
None
|
abstracts
|
Iterable[str]
|
Iterable[str], the abstract of the paper |
None
|
alls
|
Iterable[str]
|
Iterable[str], the value to search for |
None
|
journal_refs
|
Iterable[str]
|
Iterable[str], the journal reference |
None
|
categories
|
Iterable[str]
|
Iterable[str], the category |
None
|
Source code in sxolar/api/search.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
|
from_journal_refs(*journal_refs)
staticmethod
¶
Creates a new journal reference query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
journal_refs
|
Iterable[str]
|
str, the journal reference |
()
|
Source code in sxolar/api/search.py
247 248 249 250 251 252 253 254 255 256 257 258 259 |
|
from_str(value)
staticmethod
¶
Creates a new query from a string
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
str, the value to search for |
required |
Source code in sxolar/api/search.py
181 182 183 184 185 186 187 188 189 |
|
from_titles(*titles)
staticmethod
¶
Creates a new title query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
titles
|
Iterable[str]
|
str, the title of the paper |
()
|
Source code in sxolar/api/search.py
205 206 207 208 209 210 211 212 213 214 215 216 217 |
|
join(*others, operator=LogicalOperator.OR)
¶
Join multiple queries with an operator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
others
|
Iterable[Query]
|
Iterable[Query], the queries to join |
()
|
operator
|
LogicalOperator
|
LogicalOperator, the operator to use to join the queries |
OR
|
Returns:
Name | Type | Description |
---|---|---|
Query |
A new query object |
Source code in sxolar/api/search.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
or_(other)
¶
Join two queries with the OR operator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other
|
str, the other query to join with |
required |
Returns:
Name | Type | Description |
---|---|---|
Query |
A new query object |
Source code in sxolar/api/search.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
search(start=0, max_results=10, sort_by=SortBy.Relevance, sort_order=SortOrder.Descending, min_date=None, max_date=None, date_filter_field=FIELD_ENTRY_UPDATED)
¶
Searches the arxiv API with the query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
int
|
int, optional, The starting index of the results |
0
|
max_results
|
int
|
int, optional, The maximum number of results to return |
10
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of dictionaries representing the search results |
Source code in sxolar/api/search.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
to_str()
¶
Returns the string representation of the query
Source code in sxolar/api/search.py
177 178 179 |
|
wrap()
¶
Wrap the query in parenthesis
Returns:
Name | Type | Description |
---|---|---|
Query |
A new query object |
Source code in sxolar/api/search.py
128 129 130 131 132 133 134 |
|
Title
¶
Bases: Query
Represents a title query for the arxiv API
Source code in sxolar/api/search.py
343 344 345 346 347 348 349 350 351 352 353 354 355 |
|
__init__(title)
¶
Creates a new title query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title
|
str
|
str, the title of the paper |
required |
Source code in sxolar/api/search.py
346 347 348 349 350 351 352 353 354 355 |
|