search_query
Top-level package for SearchQuery.
- class search_query.AndQuery(children: List[str | Query], *, search_field: SearchField | str | None = None, position: Tuple[int, int] | None = None, platform: str = 'generic')
Bases:
Query
AND Query
- selects_record(record_dict: dict) bool
Abstract method to be implemented by subclasses to select records.
- class search_query.NEARQuery(value: str, children: List[str | Query], *, search_field: SearchField | str | None = None, position: Tuple[int, int] | None = None, distance: int, platform: str = 'generic')
Bases:
Query
NEAR Query
- property distance: int | None
Distance property.
- selects_record(record_dict: dict) bool
Check if the record matches the NEAR query.
- class search_query.OrQuery(children: List[str | Query], *, search_field: SearchField | str | None = None, position: Tuple[int, int] | None = None, platform: str = 'generic')
Bases:
Query
OR Query Class
- selects_record(record_dict: dict) bool
Abstract method to be implemented by subclasses to select records.
- class search_query.Query(value: str, *, operator: bool = True, search_field: SearchField | None = None, children: List[str | Query] | None = None, position: Tuple[int, int] | None = None, platform: str = 'generic')
Bases:
object
Query class.
- classmethod create(value: str, *, operator: bool = True, search_field: SearchField | None = None, children: List[str | Query] | None = None, position: Tuple[int, int] | None = None, platform: str = 'generic', distance: int = 0) Query
Factory method for query creation.
- evaluate(records_dict: dict) dict
Evaluate the query against records using colrev_status labels.
rev_included: relevant
rev_excluded / rev_prescreen_excluded: irrelevant
others: ignored
- get_nr_leaves() int
Returns the number of leaves in the query tree
- is_term() bool
Check whether the SearchQuery is a term.
- property operator: bool
Operator property.
- property platform: str
Platform property.
- replace(new_query) None
- property search_field: SearchField | None
Search field property.
- selects(*, record_dict: dict) bool
Indicates whether the query selects a given record.
- selects_record(record_dict: dict) bool
Abstract method to be implemented by subclasses to select records.
- set_platform_unchecked(platform: str, silent: bool = False) None
Set the platform for this query node without validation. This is an optional utility for parsers.
- to_generic_string() str
Prints the query in generic syntax
- to_string() str
Prints the query as a string
- to_structured_string() str
Prints the query in generic syntax
- translate(target_syntax: str) Query
Translate the query to the target syntax using the provided translator.
- property value: str
Value property.
- class search_query.SearchFile(search_string: str, platform: str, authors: list[dict] | None = None, record_info: dict | None = None, date: dict | None = None, filepath: str | Path | None = None, **kwargs: dict)
Bases:
object
SearchFile class.
- save(filepath: str | Path | None = None) None
Save the search file to a JSON file.
- to_dict() dict
Convert the search file to a dictionary.
- search_query.load_search_file(filepath: str | Path) SearchFile
Load a search file from a JSON file.
Modules
CLI for search-query. |
|
Constants for search-query |
|
Database and filters. |
|
Database and filters. |
|
Top-level package for EBSCOHost. |
|
Exceptions of SearchQuery. |
|
Top-level package for generic queries. |
|
Query linter hook. |
|
Validator for search queries. |
|
Query parser. |
|
Base query parser. |
|
Top-level package for PubMed. |
|
Query class. |
|
AND Query |
|
NEAR Query |
|
NOT Query |
|
OR Query |
|
Range Query |
|
Query class. |
|
SearchFile parser. |
|
Pubmed serializer. |
|
Structured serializer. |
|
Pubmed query translator. |
|
Utilities for SearchQuery. |
|
Top-level package for WoS. |